We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 57b030a + 062864a commit 722143cCopy full SHA for 722143c
include/msgpack/adaptor/pair.hpp
@@ -20,6 +20,8 @@
20
21
#include "msgpack/versioning.hpp"
22
#include "msgpack/adaptor/adaptor_base.hpp"
23
+#include "msgpack/meta.hpp"
24
+
25
#include <utility>
26
27
namespace msgpack {
@@ -33,7 +35,8 @@ namespace adaptor {
33
35
#if !defined(MSGPACK_USE_CPP03)
34
36
37
template <typename T1, typename T2>
-struct as<std::pair<T1, T2>> {
38
+struct as<std::pair<T1, T2>,
39
+ typename std::enable_if<msgpack::all_of<msgpack::has_as, T1, T2>::value>::type> {
40
std::pair<T1, T2> operator()(msgpack::object const& o) const {
41
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
42
if (o.via.array.size != 2) { throw msgpack::type_error(); }
0 commit comments