0.2.0
Loading...
Searching...
No Matches
STL.hpp File Reference

Algorithms concerning the STL containers. More...

Go to the source code of this file.

Functions

template<typename T >
std::string NAV::joinToString (const T &container, const char *delimiter=", ", const std::string &elementFormat="")
 Joins the container to a string.
 
template<typename T , typename U >
std::string NAV::joinToStringCustom (const T &container, U &&formatFunc, const char *delimiter=", ")
 Joins the container to a string.
 
template<std::size_t N>
bool NAV::operator< (const std::bitset< N > &lhs, const std::bitset< N > &rhs)
 Comparison operator for bitsets.
 

Detailed Description

Algorithms concerning the STL containers.

Author
T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
Date
2024-01-11

Function Documentation

◆ joinToString()

template<typename T >
std::string NAV::joinToString ( const T & container,
const char * delimiter = ", ",
const std::string & elementFormat = "" )

Joins the container to a string.

Parameters
[in]containerContainer to join
[in]delimiterDelimiter to use to concatenate the elements
[in]elementFormatfmt format string, which gets places inside '{}' to format the elements

◆ joinToStringCustom()

template<typename T , typename U >
std::string NAV::joinToStringCustom ( const T & container,
U && formatFunc,
const char * delimiter = ", " )

Joins the container to a string.

Parameters
[in]containerContainer to join
[in]formatFuncFunction to evaluate for each element to get the string representation
[in]delimiterDelimiter to use to concatenate the elements

◆ operator<()

template<std::size_t N>
bool NAV::operator< ( const std::bitset< N > & lhs,
const std::bitset< N > & rhs )

Comparison operator for bitsets.

Template Parameters
NAmount of bits
Parameters
[in]lhsLeft-hand side
[in]rhsRight-hand side
Returns
True when lhs < rhs