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
6121fc52
Unverified
Commit
6121fc52
authored
Apr 10, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
fix indentation
parent
ea0a7c7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
unit-allocator.cpp
test/src/unit-allocator.cpp
+13
-12
No files found.
test/src/unit-allocator.cpp
View file @
6121fc52
...
@@ -245,12 +245,13 @@ struct allocator_no_forward : std::allocator<T>
...
@@ -245,12 +245,13 @@ struct allocator_no_forward : std::allocator<T>
allocator_no_forward
(
allocator_no_forward
<
U
>
)
{}
allocator_no_forward
(
allocator_no_forward
<
U
>
)
{}
template
<
class
U
>
template
<
class
U
>
struct
rebind
{
struct
rebind
{
using
other
=
allocator_no_forward
<
U
>
;
using
other
=
allocator_no_forward
<
U
>
;
};
};
template
<
class
...
Args
>
template
<
class
...
Args
>
void
construct
(
T
*
p
,
const
Args
&
...
args
)
void
construct
(
T
*
p
,
const
Args
&
...
args
)
{
{
// force copy even if move is available
// force copy even if move is available
::
new
(
static_cast
<
void
*>
(
p
))
T
(
args
...);
::
new
(
static_cast
<
void
*>
(
p
))
T
(
args
...);
...
@@ -263,16 +264,16 @@ TEST_CASE("bad my_allocator::construct")
...
@@ -263,16 +264,16 @@ TEST_CASE("bad my_allocator::construct")
SECTION
(
"my_allocator::construct doesn't forward"
)
SECTION
(
"my_allocator::construct doesn't forward"
)
{
{
using
bad_alloc_json
=
nlohmann
::
basic_json
<
std
::
map
,
using
bad_alloc_json
=
nlohmann
::
basic_json
<
std
::
map
,
std
::
vector
,
std
::
vector
,
std
::
string
,
std
::
string
,
bool
,
bool
,
std
::
int64_t
,
std
::
int64_t
,
std
::
uint64_t
,
std
::
uint64_t
,
double
,
double
,
allocator_no_forward
>
;
allocator_no_forward
>
;
bad_alloc_json
json
;
bad_alloc_json
json
;
json
[
"test"
]
=
bad_alloc_json
::
array_t
();
json
[
"test"
]
=
bad_alloc_json
::
array_t
();
json
[
"test"
].
push_back
(
"should not leak"
);
json
[
"test"
].
push_back
(
"should not leak"
);
}
}
}
}
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