Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Teuchos::ValueTypeConversionTraits< unsigned long, std::string > Class Reference

Convert an std::string to an unsigned long. More...

#include <Teuchos_as.hpp>

Static Public Member Functions

static unsigned long safeConvert (const std::string &t)
 Convert the given std::string to an unsigned long, with checks.
 
static unsigned long convert (const std::string &t)
 Convert the given std::string to an unsigned long.
 

Detailed Description

Convert an std::string to an unsigned long.

We assume the string stores a base-10 integer, if it stores an integer at all.

Definition at line 786 of file Teuchos_as.hpp.

Member Function Documentation

◆ safeConvert()

static unsigned long Teuchos::ValueTypeConversionTraits< unsigned long, std::string >::safeConvert ( const std::string & t)
inlinestatic

Convert the given std::string to an unsigned long, with checks.

If the string overflows unsigned long, this throws std::range_error. If it does not contain an integer, this throws std::invalid_argument.

Definition at line 793 of file Teuchos_as.hpp.

◆ convert()

static unsigned long Teuchos::ValueTypeConversionTraits< unsigned long, std::string >::convert ( const std::string & t)
inlinestatic

Convert the given std::string to an unsigned long.

Definition at line 798 of file Teuchos_as.hpp.


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