Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
畅游知识海洋
json
提交
9e2f185a
J
json
项目概览
畅游知识海洋
/
json
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
json
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9e2f185a
编写于
12月 06, 2017
作者:
N
Niels Lohmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
reformatted code after PRs
上级
c5e73177
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
38 deletion
+38
-38
src/json.hpp
src/json.hpp
+38
-38
未找到文件。
src/json.hpp
浏览文件 @
9e2f185a
...
...
@@ -1353,8 +1353,8 @@ struct to_json_fn
"could not find to_json() method in T's namespace"
);
#ifdef _MSC_VER
// Visual Studio does not show a stacktrace for the above assert.
using
decayed
=
uncvref_t
<
T
>
;
// Visual Studio does not show a stacktrace for the above assert.
using
decayed
=
uncvref_t
<
T
>
;
static_assert
(
sizeof
(
typename
decayed
::
force_msvc_stacktrace
)
==
0
,
"forcing msvc stacktrace to show which T we're talking about."
);
#endif
...
...
@@ -1386,8 +1386,8 @@ struct from_json_fn
static_assert
(
sizeof
(
BasicJsonType
)
==
0
,
"could not find from_json() method in T's namespace"
);
#ifdef _MSC_VER
// Visual Studio does not show a stacktrace for the above assert.
using
decayed
=
uncvref_t
<
T
>
;
// Visual Studio does not show a stacktrace for the above assert.
using
decayed
=
uncvref_t
<
T
>
;
static_assert
(
sizeof
(
typename
decayed
::
force_msvc_stacktrace
)
==
0
,
"forcing msvc stacktrace to show which T we're talking about."
);
#endif
...
...
@@ -7945,14 +7945,14 @@ class basic_json
{
AllocatorType
<
T
>
alloc
;
using
AllocatorTraits
=
std
::
allocator_traits
<
AllocatorType
<
T
>>
;
using
AllocatorTraits
=
std
::
allocator_traits
<
AllocatorType
<
T
>>
;
auto
deleter
=
[
&
](
T
*
object
)
{
AllocatorTraits
::
deallocate
(
alloc
,
object
,
1
);
AllocatorTraits
::
deallocate
(
alloc
,
object
,
1
);
};
std
::
unique_ptr
<
T
,
decltype
(
deleter
)
>
object
(
AllocatorTraits
::
allocate
(
alloc
,
1
),
deleter
);
AllocatorTraits
::
construct
(
alloc
,
object
.
get
(),
std
::
forward
<
Args
>
(
args
)...);
AllocatorTraits
::
construct
(
alloc
,
object
.
get
(),
std
::
forward
<
Args
>
(
args
)...);
assert
(
object
!=
nullptr
);
return
object
.
release
();
}
...
...
@@ -8115,37 +8115,37 @@ class basic_json
void
destroy
(
value_t
t
)
{
switch
(
t
)
{
case
value_t
::
object
:
{
AllocatorType
<
object_t
>
alloc
;
std
::
allocator_traits
<
decltype
(
alloc
)
>::
destroy
(
alloc
,
object
);
std
::
allocator_traits
<
decltype
(
alloc
)
>::
deallocate
(
alloc
,
object
,
1
);
break
;
}
case
value_t
::
array
:
{
AllocatorType
<
array_t
>
alloc
;
std
::
allocator_traits
<
decltype
(
alloc
)
>::
destroy
(
alloc
,
array
);
std
::
allocator_traits
<
decltype
(
alloc
)
>::
deallocate
(
alloc
,
array
,
1
);
break
;
}
case
value_t
::
string
:
{
AllocatorType
<
string_t
>
alloc
;
std
::
allocator_traits
<
decltype
(
alloc
)
>::
destroy
(
alloc
,
string
);
std
::
allocator_traits
<
decltype
(
alloc
)
>::
deallocate
(
alloc
,
string
,
1
);
break
;
}
default:
{
break
;
}
}
switch
(
t
)
{
case
value_t
::
object
:
{
AllocatorType
<
object_t
>
alloc
;
std
::
allocator_traits
<
decltype
(
alloc
)
>::
destroy
(
alloc
,
object
);
std
::
allocator_traits
<
decltype
(
alloc
)
>::
deallocate
(
alloc
,
object
,
1
);
break
;
}
case
value_t
::
array
:
{
AllocatorType
<
array_t
>
alloc
;
std
::
allocator_traits
<
decltype
(
alloc
)
>::
destroy
(
alloc
,
array
);
std
::
allocator_traits
<
decltype
(
alloc
)
>::
deallocate
(
alloc
,
array
,
1
);
break
;
}
case
value_t
::
string
:
{
AllocatorType
<
string_t
>
alloc
;
std
::
allocator_traits
<
decltype
(
alloc
)
>::
destroy
(
alloc
,
string
);
std
::
allocator_traits
<
decltype
(
alloc
)
>::
deallocate
(
alloc
,
string
,
1
);
break
;
}
default:
{
break
;
}
}
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录