plll  1.0
plll::arithmetic::implementation::from_string_conversion< Context > Class Template Reference

Provides facilities to convert strings to types. More...

#include <arithmetic.hpp>

Detailed Description

template<class Context>
class plll::arithmetic::implementation::from_string_conversion< Context >

Provides facilities to convert strings to types.

Default implementation for type to string conversion. Uses std::istringstream.

It should define two member types RetVal1 and RetVal2, and four static member functions:

  • bool convert(Context::Type &, const std::string &, const Context &): converts the given std::string string to the type using the given context's information. The result is stored in the first argument. The return value is true if the conversion succeeded, and false if it failed.
  • bool convert(Context::Type &, const char *, const Context &): converts the given C-style string to the type using the given context's information. The result is stored in the first argument. The return value is true if the conversion succeeded, and false if it failed.
  • RetVal1 convert(const std::string &, const Context &): converts the given std::string string to the type using the given context's information. The result is returned. The behavior is undefined in case the string cannot be converted.
  • RetVal2 convert(const char *, const Context &): converts the given C-style string to the type using the given context's information. The result is returned. The behavior is undefined in case the string cannot be converted.

Definition at line 1561 of file arithmetic.hpp.


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