13#include <boost/format.hpp>
17template <
typename T,
typename Range>
22 std::string possible_values =
"";
24 for (
const T& v : range) {
26 possible_values +=
", ";
30 boost::str(boost::format(
"assertion failed:\n"
31 " %s is not a valid %s.\n"
32 " possible values are: [%s].\n")
#define UHD_INLINE
Definition config.h:65
auto to_str(const T &val) -> std::enable_if_t< std::is_arithmetic_v< T > &&!std::is_floating_point_v< T > &&!std::is_same_v< T, int8_t > &&!std::is_same_v< T, uint8_t > &&!std::is_enum_v< T > &&!detail::has_to_string_method< T >::value, decltype(std::to_string(val))>
SFINAE-based template for integer types that std::to_string can handle.
Definition cast.hpp:167
Definition build_info.hpp:12
UHD_INLINE bool has(const Range &range, const T &value)
Definition algorithm.hpp:68
void assert_has(const Range &range, const T &value, const std::string &what="unknown")
Definition assert_has.ipp:18
Definition exception.hpp:48