|
mc_rtc
2.14.0
|
Functions | |
| template<typename Container , typename std::enable_if<!std::is_arithmetic< typename Container::value_type >::value, int >::type = 0> | |
| std::string | to_string (const Container &c, const std::string &delimiter=", ") |
| template<typename Container , typename std::enable_if< std::is_arithmetic< typename Container::value_type >::value, int >::type = 0> | |
| std::string | to_string (const Container &c, const std::string &delimiter=", ", const unsigned precision=std::numeric_limits< typename Container::value_type >::digits10) |
| Variant of to_string that converts numeric types to string. More... | |
| template<typename Container , typename Callback , typename std::enable_if<!std::is_convertible< Callback, std::string >::value, int >::type = 0> | |
| std::string | to_string (const Container &c, Callback &&get_value, const std::string &delimiter=", ") |
| std::string mc_rtc::io::to_string | ( | const Container & | c, |
| Callback && | get_value, | ||
| const std::string & | delimiter = ", " |
||
| ) |
Converts a container to a string
Example:
| Container | An iterable container whose unerlying type is convertible to std::string. The container must define Container::value_type. |
| c | Container to convert |
| get_value | Lambda or functor that converts a single element from the container (of type Container::value_type) to std::string |
| std::string mc_rtc::io::to_string | ( | const Container & | c, |
| const std::string & | delimiter = ", " |
||
| ) |
Converts a container to a string
| Container | A container whose underlying type is convertible to std::string. The container must define Container::value_type. |
| c | Container to convert |
| delimiter | Separator between the elements. By default they are coma-separated |
| std::string mc_rtc::io::to_string | ( | const Container & | c, |
| const std::string & | delimiter = ", ", |
||
| const unsigned | precision = std::numeric_limits<typename Container::value_type>::digits10 |
||
| ) |
Variant of to_string that converts numeric types to string.
| precision | Number of digits to keep. The default precision corresponds to the number of decimal digits that can be represented without change. |