OpenWalnut  1.5.0dev
Static Public Member Functions | List of all members
string_utils::fromStringImpl< Target > Struct Template Reference

Conversion class to convert a string to a given target type. More...

#include <WStringUtils.h>

Static Public Member Functions

static Target fromString (const std::string &from)
 Convert a given string to the target type. More...
 

Detailed Description

template<typename Target>
struct string_utils::fromStringImpl< Target >

Conversion class to convert a string to a given target type.

We place this in separate classes as we are not allowed to specialize function templates. But we need specializations for certain cases.

Template Parameters
Targettarget type

Definition at line 67 of file WStringUtils.h.

Member Function Documentation

◆ fromString()

template<typename Target >
static Target string_utils::fromStringImpl< Target >::fromString ( const std::string &  from)
inlinestatic

Convert a given string to the target type.

If this fails, a exception is thrown.

Exceptions
WTypeMismatchif source string cannot be converted to target type value.
Parameters
fromsource string
Returns
target value

Definition at line 78 of file WStringUtils.h.

Referenced by string_utils::fromString().

+ Here is the caller graph for this function:

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