AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::ut::AssertMessage< T > Struct Template Reference

Assertion message with its location. More...

#include <assert.hpp>

Collaboration diagram for anch::ut::AssertMessage< T >:

Public Member Functions

template<typename S>
requires std::convertible_to<const S&, std::string_view>
consteval AssertMessage (const S &fmt, std::source_location loc=std::source_location::current())

Public Attributes

std::format_string< const T &... > format
std::source_location location

Detailed Description

template<typename... T>
struct anch::ut::AssertMessage< T >

Assertion message with its location.

Format string of assertThat : the format string is checked at compile time against the arguments types (as std::format does) and the location of the call is captured.
It is built implicitly from a string literal ; it should not be used directly.

Template Parameters
Tthe message's arguments types
Author
Vincent Lachenal
Since
0.2

Constructor & Destructor Documentation

◆ AssertMessage()

template<typename... T>
template<typename S>
requires std::convertible_to<const S&, std::string_view>
anch::ut::AssertMessage< T >::AssertMessage ( const S & fmt,
std::source_location loc = std::source_location::current() )
consteval

AssertMessage constructor

Template Parameters
Sthe format string type (string literal)
Parameters
fmtthe format string
locthe assertion location (default to caller location)

Member Data Documentation

◆ format

template<typename... T>
std::format_string<const T&...> anch::ut::AssertMessage< T >::format

Format string checked at compile time

◆ location

template<typename... T>
std::source_location anch::ut::AssertMessage< T >::location

Assertion location


The documentation for this struct was generated from the following file: