Teuchos - Trilinos Tools Package  Version of the Day
Static Public Member Functions | List of all members
Teuchos::ValueTypeConversionTraits< int, long > Class Template Reference

Convert from long to int. More...

#include <Teuchos_as.hpp>

Static Public Member Functions

static int convert (const long t)
 Convert the given long to an int. More...
 
static int safeConvert (const long t)
 Convert from long to int, checking for overflow first. More...
 

Detailed Description

template<>
class Teuchos::ValueTypeConversionTraits< int, long >

Convert from long to int.

Definition at line 1964 of file Teuchos_as.hpp.

Member Function Documentation

◆ convert()

static int Teuchos::ValueTypeConversionTraits< int, long >::convert ( const long  t)
inlinestatic

Convert the given long to an int.

Warning
long integer values may overflow int, depending on your platform. You should use safeConvert() if you aren't sure that the given long value fits in an int.

Definition at line 1971 of file Teuchos_as.hpp.

◆ safeConvert()

static int Teuchos::ValueTypeConversionTraits< int, long >::safeConvert ( const long  t)
inlinestatic

Convert from long to int, checking for overflow first.

Definition at line 1978 of file Teuchos_as.hpp.


The documentation for this class was generated from the following file: