C++Spec 1.1.0
BDD testing for C++
Loading...
Searching...
No Matches
CppSpec::Util::is_c_string Concept Reference

Checks whether T is a C string: a pointer to char, const or not, or a char array, which decays to one. More...

#include <util.hpp>

Concept definition

template<typename T>
concept is_c_string = std::is_pointer_v<std::decay_t<T>> &&
std::same_as<std::remove_const_t<std::remove_pointer_t<std::decay_t<T>>>, char>
Checks whether T is a C string: a pointer to char, const or not, or a char array, which decays to one...
Definition util.hpp:152

Detailed Description

Checks whether T is a C string: a pointer to char, const or not, or a char array, which decays to one.

A pointer to volatile char is not a C string: it is printed and compared as a plain pointer.

Template Parameters
Ta type to check