Skip to content

Commit 76d5ce3

Browse files
committed
Add tag_invoke for identifier
1 parent c74758e commit 76d5ce3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

phlex/configuration.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,10 @@ namespace phlex {
8080
auto layer = value_decorate_exception<std::string>(query_object, "layer");
8181
return product_query{experimental::product_specification::create(product), layer};
8282
}
83+
84+
experimental::identifier experimental::tag_invoke(boost::json::value_to_tag<identifier> const&,
85+
boost::json::value const& jv)
86+
{
87+
return identifier{std::string_view(jv.as_string())};
88+
}
8389
}

phlex/configuration.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "boost/json.hpp"
55
#include "phlex/core/product_query.hpp"
6+
#include "phlex/model/identifier.hpp"
67

78
#include <optional>
89
#include <string>
@@ -90,6 +91,11 @@ namespace phlex {
9091
product_query tag_invoke(boost::json::value_to_tag<product_query> const&,
9192
boost::json::value const& jv);
9293

94+
namespace experimental {
95+
identifier tag_invoke(boost::json::value_to_tag<identifier> const&,
96+
boost::json::value const& jv);
97+
}
98+
9399
template <std::size_t N>
94100
std::array<product_query, N> tag_invoke(
95101
boost::json::value_to_tag<std::array<product_query, N>> const&, boost::json::value const& jv)

0 commit comments

Comments
 (0)