DNA Calib 1.1
Project brief
Transparent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5namespace 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.
13template<typename T>
15 using WrappedType = T;
17};
18
19template<typename T>
21 return Transparent<T>{data};
22}
23
24} // namespace terse
Definition: Archive.h:14
Transparent< T > transparent(T &data)
Definition: Transparent.h:20
Definition: Transparent.h:14
T WrappedType
Definition: Transparent.h:15
WrappedType & data
Definition: Transparent.h:16