Libmagicxx v10.0.3
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
Loading...
Searching...
No Matches
Recognition::Utility::StringConverter Concept Reference

Concept for callables that convert a value to std::string. More...

#include <utility.hpp>

Concept definition

template<typename ValueT, typename StringConverterT>
std::invoke_result_t<StringConverterT, ValueT>,
std::string
>
Concept for callables that convert a value to std::string.
Definition utility.hpp:159

Detailed Description

Concept for callables that convert a value to std::string.

A callable satisfies StringConverter if it can be invoked with a value of type ValueT and returns std::string.

Template Parameters
ValueTThe type of value to convert.
StringConverterTThe callable type.

Example

// Lambda satisfying StringConverter<int>
auto converter = [](int x) { return std::to_string(x); };
static_assert(StringConverter<int, decltype(converter)>);
// Function pointer
std::string intToString(int x);
static_assert(StringConverter<int, decltype(&intToString)>);
Since
10.0.0