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 1 year 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

At the moment I'm not sure we can do this before switching to C++20.

ColinH avatar Jul 18 '23 19:07 ColinH

Ok, but this then means it's going to take a long time, since the yet to be released 1.0 will be C++17, correct?

michael-brade avatar Sep 11 '23 19:09 michael-brade

That depends on how long it will take ;-)

ColinH avatar Sep 16 '23 13:09 ColinH