json icon indicating copy to clipboard operation
json copied to clipboard

feature request: std::string_view as first argument to TAO_JSON_BIND_REQUIRED

Open michael-brade opened this issue 11 months ago • 3 comments

So now I am back working on json - and here is the first feature request: please implement a way for TAO_JSON_BIND_REQUIRED to accept an std::string_view as its first argument so that something like this is possible:

enum class Keys {
      date
};

template<typename T, typename = void>
struct my_traits
    : public tao::json::traits<T>
{};

template<>
struct my_traits<test>
    : public tao::json::binding::object<TAO_JSON_BIND_REQUIRED(magic_enum::enum_name(Keys::date), &test::date)>
{};

michael-brade avatar Jul 01 '23 17:07 michael-brade