DNA Calib
1.1
Project brief
dnacalib
DNACalib
src
terse
types
Transparent.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
namespace
terse
{
6
7
// Textual serialization (currently JSON only) generates a pair of braces (`{}`) around every type
8
// that has a load, save or serialize member or free function, capable of serializing the type in question.
9
// In some cases, with lots of nested structures, for a simpler textual representation, some of these
10
// layers of abstractions might be preferable to be ignored. The Transparent<T> wrapper type is used for
11
// exactly that purpose. By wrapping any member from within a serializer function, that member will be
12
// treated as transparent, thus avoiding the generation of a pair of braces for it.
13
template
<
typename
T>
14
struct
Transparent
{
15
using
WrappedType
= T;
16
WrappedType
&
data
;
17
};
18
19
template
<
typename
T>
20
Transparent<T>
transparent
(T& data) {
21
return
Transparent<T>
{data};
22
}
23
24
}
// namespace terse
terse
Definition:
Archive.h:14
terse::transparent
Transparent< T > transparent(T &data)
Definition:
Transparent.h:20
terse::Transparent
Definition:
Transparent.h:14
terse::Transparent::WrappedType
T WrappedType
Definition:
Transparent.h:15
terse::Transparent::data
WrappedType & data
Definition:
Transparent.h:16
Generated by
1.9.4