Skip to content

Commit d8e9941

Browse files
committed
Merge pull request #434 from redboltz/fix_417
Fix 417
2 parents 07e635f + 1244ede commit d8e9941

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

include/msgpack/v2/adaptor/adaptor_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct pack : v1::adaptor::pack<T, Enabler> {
3232
};
3333

3434
template <typename T, typename Enabler>
35-
struct object : v1::adaptor::object<T, Enabler> {
35+
struct object<T, Enabler, typename msgpack::enable_if<!msgpack::is_same<T, std::string>::value>::type> : v1::adaptor::object<T, Enabler> {
3636
};
3737

3838
template <typename T, typename Enabler>

include/msgpack/v2/adaptor/adaptor_base_decl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct convert;
3030
template <typename T, typename Enabler = void>
3131
struct pack;
3232

33-
template <typename T, typename Enabler = void>
33+
template <typename T, typename Enabler = void, typename Enabler2 = void>
3434
struct object;
3535

3636
template <typename T, typename Enabler = void>

test/object_with_zone.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ TEST(object_with_zone, string)
316316
EXPECT_EQ(obj.as<string>()[0], 'a');
317317
}
318318

319+
#if MSGPACK_DEFAULT_API_VERSION == 1
320+
319321
TEST(object_without_zone, string)
320322
{
321323
string v = "abc";
@@ -326,6 +328,8 @@ TEST(object_without_zone, string)
326328
EXPECT_EQ(obj.as<string>()[0], 'd');
327329
}
328330

331+
#endif // MSGPACK_DEFAULT_API_VERSION == 1
332+
329333
// char*
330334
TEST(object_with_zone, char_ptr)
331335
{

0 commit comments

Comments
 (0)