siplasplas
A library for C++ reflection and introspection
Utility

Some random utilities needed by other siplasplas modules. More...

Modules

 Assert
 Assertion utilities.
 
 Dynamic-library
 Cross platform API to load symbols from shared librarties at runtime.
 
 Error-handling
 Error handling tools.
 
 Hash
 Hashing utilities based on std::hash.
 

Functions

template<typename T >
std::string cpp::lexical_cast (const T &value)
 Returns an string representation of a value. More...
 
template<typename T >
cpp::lexical_cast (const std::string &value)
 Returns an string representation of a value. More...
 

Detailed Description

Some random utilities needed by other siplasplas modules.

The siplaspals-utility module implements various utilities used in the implementation of other siplasplas modules. These utilities are not grouped in any special way, but we encourage the policy of rising utilities into full-fledged modules if these became too complex.

Todo:

Move meta.hpp, function_traits.hpp, tuple.hpp, and fusion.hpp to a siplasplas-meta module.

Move error_logger.hpp and exception.hpp to a siplasplas-exception module?

Move cpp::Overload<> to function_traits.hpp

siplasplas-utility includes the following features:

Function Documentation

template<typename T >
std::string cpp::lexical_cast ( const T &  value)

Returns an string representation of a value.

This function invokes operator<<(std::ostream&, const T&) to get an string representation of a given value.

It's a simplified version of the Boost.Lexical_Cast library.

Template Parameters
Tvalue type. Must have a valid operator<<(std::ostream&, T) overload.
Parameters
valueValue which is translated to a string.
Returns
A string representation of the given value.
template<typename T >
T cpp::lexical_cast ( const std::string &  value)

Returns an string representation of a value.

This function invokes operator>>(std::istream&, T&) to assign a T value from an string representation of it.

It's a simplified version of the Boost.Lexical_Cast library.

Template Parameters
TRequired output value type. Must have a valid operator>>(std::istream&, T&) overload.
Parameters
valueString representation of the value.
Returns
A value of type T equivalent to the value string representation argument.