Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
cc4a8319
Commit
cc4a8319
authored
Feb 14, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reverse iterators
parent
d87e7707
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
1 deletion
+32
-1
.gitignore
.gitignore
+2
-0
json.hpp
src/json.hpp
+0
-0
json.hpp.re2c
src/json.hpp.re2c
+30
-1
unit.cpp
test/unit.cpp
+0
-0
No files found.
.gitignore
View file @
cc4a8319
.deps
utf8_test
json_unit
src/json.hpp
View file @
cc4a8319
This diff is collapsed.
Click to expand it.
src/json.hpp.re2c
View file @
cc4a8319
...
...
@@ -93,7 +93,10 @@ class basic_json
using iterator = basic_json::iterator;
/// a const iterator for a basic_json container
using const_iterator = basic_json::const_iterator;
/// a reverse iterator for a basic_json container
using reverse_iterator = std::reverse_iterator<iterator>;
/// a const reverse iterator for a basic_json container
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
///////////////////////////
// JSON value data types //
...
...
@@ -264,6 +267,8 @@ class basic_json
std::enable_if<
not std::is_same<V, basic_json::iterator>::value and
not std::is_same<V, basic_json::const_iterator>::value and
not std::is_same<V, basic_json::reverse_iterator>::value and
not std::is_same<V, basic_json::const_reverse_iterator>::value and
not std::is_same<V, typename array_t::iterator>::value and
not std::is_same<V, typename array_t::const_iterator>::value and
std::is_constructible<basic_json, typename V::value_type>::value, int>::type
...
...
@@ -822,6 +827,30 @@ class basic_json
return result;
}
/// returns a reverse iterator to the beginning
inline reverse_iterator rbegin() noexcept
{
return reverse_iterator(end());
}
/// returns a reverse iterator to the end
inline reverse_iterator rend() noexcept
{
return reverse_iterator(begin());
}
/// returns a reverse iterator to the beginning
inline const_reverse_iterator crbegin() const noexcept
{
return const_reverse_iterator(cend());
}
/// returns a reverse iterator to the end
inline const_reverse_iterator crend() const noexcept
{
return const_reverse_iterator(cbegin());
}
//////////////
// capacity //
...
...
test/unit.cpp
View file @
cc4a8319
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment