mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-30 16:03:29 +02:00
Fixed osx compile error.
This commit is contained in:
parent
d91c510d8c
commit
41f27b5d62
@ -60,6 +60,14 @@ struct as_impl {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct as_impl<T, 1> {
|
||||||
|
static std::array<T, 1> as(msgpack::object const& o) {
|
||||||
|
msgpack::object* p = o.via.array.ptr;
|
||||||
|
return std::array<T, 1>{{p->as<T>()}};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct as_impl<T, 0> {
|
struct as_impl<T, 0> {
|
||||||
static std::array<T, 0> as(msgpack::object const&) {
|
static std::array<T, 0> as(msgpack::object const&) {
|
||||||
|
@ -37,7 +37,6 @@ namespace type {
|
|||||||
using std::tuple_element;
|
using std::tuple_element;
|
||||||
using std::uses_allocator;
|
using std::uses_allocator;
|
||||||
using std::ignore;
|
using std::ignore;
|
||||||
using std::tie;
|
|
||||||
using std::swap;
|
using std::swap;
|
||||||
|
|
||||||
template< class... Types >
|
template< class... Types >
|
||||||
@ -100,6 +99,10 @@ namespace type {
|
|||||||
) {
|
) {
|
||||||
return std::tuple_cat(std::forward<typename std::remove_reference<Tuples>::type::base>(args)...);
|
return std::tuple_cat(std::forward<typename std::remove_reference<Tuples>::type::base>(args)...);
|
||||||
}
|
}
|
||||||
|
template <class... Args>
|
||||||
|
inline tuple<Args&...> tie(Args&... args) {
|
||||||
|
return tuple<Args&...>(args...);
|
||||||
|
}
|
||||||
} // namespace type
|
} // namespace type
|
||||||
|
|
||||||
// --- Pack from tuple to packer stream ---
|
// --- Pack from tuple to packer stream ---
|
||||||
|
@ -294,7 +294,7 @@ struct tr1_hash : std::tr1::hash<Key> {
|
|||||||
#include "msgpack/adaptor/tr1/unordered_map.hpp"
|
#include "msgpack/adaptor/tr1/unordered_map.hpp"
|
||||||
TEST(MSGPACK_TR1, simple_buffer_tr1_unordered_map)
|
TEST(MSGPACK_TR1, simple_buffer_tr1_unordered_map)
|
||||||
{
|
{
|
||||||
typedef tr1::unordered_map<int, int, test::tr1_hash<int>, test::equal_to<int>, test::allocator<std::pair<int, int> > > type;
|
typedef tr1::unordered_map<int, int, test::tr1_hash<int>, test::equal_to<int>, test::allocator<std::pair<const int, int> > > type;
|
||||||
for (unsigned int k = 0; k < kLoop; k++) {
|
for (unsigned int k = 0; k < kLoop; k++) {
|
||||||
type val1;
|
type val1;
|
||||||
for (unsigned int i = 0; i < kElements; i++)
|
for (unsigned int i = 0; i < kElements; i++)
|
||||||
@ -413,7 +413,7 @@ struct hash : std::hash<Key> {
|
|||||||
#include "msgpack/adaptor/tr1/unordered_map.hpp"
|
#include "msgpack/adaptor/tr1/unordered_map.hpp"
|
||||||
TEST(MSGPACK_TR1, simple_buffer_unordered_map)
|
TEST(MSGPACK_TR1, simple_buffer_unordered_map)
|
||||||
{
|
{
|
||||||
typedef unordered_map<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<int, int> > > type;
|
typedef unordered_map<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<const int, int> > > type;
|
||||||
for (unsigned int k = 0; k < kLoop; k++) {
|
for (unsigned int k = 0; k < kLoop; k++) {
|
||||||
type val1;
|
type val1;
|
||||||
for (unsigned int i = 0; i < kElements; i++)
|
for (unsigned int i = 0; i < kElements; i++)
|
||||||
@ -434,7 +434,7 @@ TEST(MSGPACK_TR1, simple_buffer_unordered_map)
|
|||||||
|
|
||||||
TEST(MSGPACK_TR1, simple_buffer_unordered_multimap)
|
TEST(MSGPACK_TR1, simple_buffer_unordered_multimap)
|
||||||
{
|
{
|
||||||
typedef unordered_multimap<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<int, int> > > type;
|
typedef unordered_multimap<int, int, test::hash<int>, test::equal_to<int>, test::allocator<std::pair<const int, int> > > type;
|
||||||
for (unsigned int k = 0; k < kLoop; k++) {
|
for (unsigned int k = 0; k < kLoop; k++) {
|
||||||
type val1;
|
type val1;
|
||||||
for (unsigned int i = 0; i < kElements; i++) {
|
for (unsigned int i = 0; i < kElements; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user