C++Spec 1.0.0
BDD testing for C++
Loading...
Searching...
No Matches
util.hpp File Reference

Utility functions and classes. More...

#include <functional>
#include <ranges>
#include <sstream>
#include <string>
#include <type_traits>
Include dependency graph for util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CppSpec::Util::verbose_assert< result >
 Helper class for static assertions that has a built-in error string. More...
 

Concepts

concept  CppSpec::Util::is_container
 Concept for checking whether T is a container type.
 
concept  CppSpec::Util::is_streamable
 Checks whether T can be streamed.
 
concept  CppSpec::Util::is_functional
 
concept  CppSpec::Util::is_not_functional
 
concept  CppSpec::Util::not_c_string
 

Functions

std::string CppSpec::Util::demangle (const char *name)
 
std::string CppSpec::Util::join (std::ranges::range auto &iterable, const std::string &separator="")
 Implode a string.
 
std::string CppSpec::Util::join_endl (std::ranges::range auto &&iterable)
 

Detailed Description

Utility functions and classes.

Function Documentation

◆ demangle()

std::string CppSpec::Util::demangle ( const char * name)
inline

Demangle a symbol into a human-readable string.

Parameters
mangledthe mangled symbol
Returns
a human-readable translation of the given symbol

◆ join()

std::string CppSpec::Util::join ( std::ranges::range auto & iterable,
const std::string & separator = "" )
inlinenodiscard

Implode a string.

Template Parameters
Rangethe type of the iterable object. is_iterable<Range>::value must evaluate to true.
Parameters
iterablean iterable object
separatora user-defined separator to delimit elements
Returns
the joined string