// // json_direct_tuple_binder.hpp // json // // Created by Sam Jaffe on 2/26/17. // #pragma once namespace json { namespace binder { template class get_binder : public binder_impl { public: using value_type = typename std::remove_reference(std::declval()))>::type; get_binder(binder val_binder) : impl(std::move(val_binder)) { } get_binder(binder_impl const & val_binder = value_binder()) : impl(val_binder) { } virtual binder_impl* clone() const override { return new get_binder(*this); } virtual void parse(T& object, char const*& data, parser::options opts) const override { impl.parse(std::get(object), data, opts); } virtual void write(T const& val, std::ostream & data) const override { impl.write(std::get(val), data); } private: binder impl; }; } }