Skip to content

Commit 7e2076b

Browse files
committed
Merge pull request #333 from redboltz/fix_osx_build
Fixed osx compile error.
2 parents d91c510 + 41f27b5 commit 7e2076b

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

include/msgpack/adaptor/cpp11/array.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ struct as_impl {
6060
}
6161
};
6262

63+
template <typename T>
64+
struct as_impl<T, 1> {
65+
static std::array<T, 1> as(msgpack::object const& o) {
66+
msgpack::object* p = o.via.array.ptr;
67+
return std::array<T, 1>{{p->as<T>()}};
68+
}
69+
};
70+
6371
template <typename T>
6472
struct as_impl<T, 0> {
6573
static std::array<T, 0> as(msgpack::object const&) {

include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ namespace type {
3737
using std::tuple_element;
3838
using std::uses_allocator;
3939
using std::ignore;
40-
using std::tie;
4140
using std::swap;
4241

4342
template< class... Types >
@@ -100,6 +99,10 @@ namespace type {
10099
) {
101100
return std::tuple_cat(std::forward<typename std::remove_reference<Tuples>::type::base>(args)...);
102101
}
102+
template <class... Args>
103+
inline tuple<Args&...> tie(Args&... args) {
104+
return tuple<Args&...>(args...);
105+
}
103106
} // namespace type
104107

105108
// --- Pack from tuple to packer stream ---

test/msgpack_container.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ struct tr1_hash : std::tr1::hash<Key> {
294294
#include "msgpack/adaptor/tr1/unordered_map.hpp"
295295
TEST(MSGPACK_TR1, simple_buffer_tr1_unordered_map)
296296
{
297-
typedef tr1::unordered_map<int, int, test::tr1_hash<int>, test::equal_to<int>, test::allocator<std::pair<int, int> > > type;
297+
typedef tr1::unordered_map<int, int, test::tr1_hash<int>, test::equal_to<int>, test::allocator<std::pair<const int, int> > > type;
298298
for (unsigned int k = 0; k < kLoop; k++) {
299299
type val1;
300300
for (unsigned int i = 0; i < kElements; i++)
@@ -413,7 +413,7 @@ struct hash : std::hash<Key> {
413413
#include "msgpack/adaptor/tr1/unordered_map.hpp"
414414
TEST(MSGPACK_TR1, simple_buffer_unordered_map)
415415
{
416-
typedef unordered_map<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<int, int> > > type;
416+
typedef unordered_map<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<const int, int> > > type;
417417
for (unsigned int k = 0; k < kLoop; k++) {
418418
type val1;
419419
for (unsigned int i = 0; i < kElements; i++)
@@ -434,7 +434,7 @@ TEST(MSGPACK_TR1, simple_buffer_unordered_map)
434434

435435
TEST(MSGPACK_TR1, simple_buffer_unordered_multimap)
436436
{
437-
typedef unordered_multimap<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<int, int> > > type;
437+
typedef unordered_multimap<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<const int, int> > > type;
438438
for (unsigned int k = 0; k < kLoop; k++) {
439439
type val1;
440440
for (unsigned int i = 0; i < kElements; i++) {

0 commit comments

Comments
 (0)