Skip to content

Commit

Permalink
more on #48: allowing non-std begin/end functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Mar 24, 2015
1 parent 6fc52f3 commit e318889
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ class basic_json
{
Allocator<object_t> alloc;
m_value.object = alloc.allocate(1);
alloc.construct(m_value.object, std::begin(value), std::end(value));
using std::begin;
using std::end;
alloc.construct(m_value.object, begin(value), end(value));
}

/// create an array (explicit)
Expand Down Expand Up @@ -439,7 +441,9 @@ class basic_json
{
Allocator<array_t> alloc;
m_value.array = alloc.allocate(1);
alloc.construct(m_value.array, std::begin(value), std::end(value));
using std::begin;
using std::end;
alloc.construct(m_value.array, begin(value), end(value));
}

/// create a string (explicit)
Expand Down
8 changes: 6 additions & 2 deletions src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ class basic_json
{
Allocator<object_t> alloc;
m_value.object = alloc.allocate(1);
alloc.construct(m_value.object, std::begin(value), std::end(value));
using std::begin;
using std::end;
alloc.construct(m_value.object, begin(value), end(value));
}

/// create an array (explicit)
Expand Down Expand Up @@ -439,7 +441,9 @@ class basic_json
{
Allocator<array_t> alloc;
m_value.array = alloc.allocate(1);
alloc.construct(m_value.array, std::begin(value), std::end(value));
using std::begin;
using std::end;
alloc.construct(m_value.array, begin(value), end(value));
}

/// create a string (explicit)
Expand Down

0 comments on commit e318889

Please sign in to comment.