The Battle for Wesnoth  1.15.3+dev
Functions
conversion_helper.hpp File Reference
#include <limits>
#include <stdexcept>
Include dependency graph for conversion_helper.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T , typename K >
checked_cast (K value)
 
template<typename T >
string_cast (const std::string &str)
 
template<>
unsigned long string_cast (const std::string &str)
 
template<>
unsigned int string_cast (const std::string &str)
 
template<>
unsigned long long string_cast (const std::string &str)
 
template<>
long long string_cast (const std::string &str)
 
template<>
double string_cast (const std::string &str)
 
template<>
float string_cast (const std::string &str)
 

Function Documentation

◆ checked_cast()

template<typename T , typename K >
T checked_cast ( value)
inline

Definition at line 21 of file conversion_helper.hpp.

Referenced by string_cast().

◆ string_cast() [1/7]

template<typename T >
T string_cast ( const std::string &  str)
inline

◆ string_cast() [2/7]

template<>
unsigned long string_cast ( const std::string &  str)
inline

Definition at line 38 of file conversion_helper.hpp.

◆ string_cast() [3/7]

template<>
unsigned int string_cast ( const std::string &  str)
inline

Definition at line 48 of file conversion_helper.hpp.

References checked_cast(), str, and string_cast().

◆ string_cast() [4/7]

template<>
unsigned long long string_cast ( const std::string &  str)
inline

Definition at line 55 of file conversion_helper.hpp.

◆ string_cast() [5/7]

template<>
long long string_cast ( const std::string &  str)
inline

Definition at line 65 of file conversion_helper.hpp.

◆ string_cast() [6/7]

template<>
double string_cast ( const std::string &  str)
inline

Definition at line 75 of file conversion_helper.hpp.

◆ string_cast() [7/7]

template<>
float string_cast ( const std::string &  str)
inline

Definition at line 90 of file conversion_helper.hpp.