Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
6e87b370
Commit
6e87b370
authored
Oct 02, 2019
by
Andy Maloney
Committed by
Jesse Beder
Oct 02, 2019
Browse files
Modernize: Use "using" instead of "typedef" (#754)
parent
0fddd1e5
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
44 additions
and
44 deletions
+44
-44
include/yaml-cpp/anchor.h
include/yaml-cpp/anchor.h
+1
-1
include/yaml-cpp/node/detail/bool_type.h
include/yaml-cpp/node/detail/bool_type.h
+1
-1
include/yaml-cpp/node/detail/iterator.h
include/yaml-cpp/node/detail/iterator.h
+1
-1
include/yaml-cpp/node/detail/iterator_fwd.h
include/yaml-cpp/node/detail/iterator_fwd.h
+2
-2
include/yaml-cpp/node/detail/memory.h
include/yaml-cpp/node/detail/memory.h
+1
-1
include/yaml-cpp/node/detail/node.h
include/yaml-cpp/node/detail/node.h
+1
-1
include/yaml-cpp/node/detail/node_data.h
include/yaml-cpp/node/detail/node_data.h
+4
-4
include/yaml-cpp/node/detail/node_iterator.h
include/yaml-cpp/node/detail/node_iterator.h
+12
-12
include/yaml-cpp/node/impl.h
include/yaml-cpp/node/impl.h
+4
-4
include/yaml-cpp/node/node.h
include/yaml-cpp/node/node.h
+2
-2
include/yaml-cpp/node/ptr.h
include/yaml-cpp/node/ptr.h
+5
-5
include/yaml-cpp/traits.h
include/yaml-cpp/traits.h
+2
-2
src/binary.cpp
src/binary.cpp
+1
-1
src/nodebuilder.h
src/nodebuilder.h
+2
-2
src/nodeevents.h
src/nodeevents.h
+2
-2
src/setting.h
src/setting.h
+1
-1
src/singledocparser.h
src/singledocparser.h
+1
-1
src/stream.cpp
src/stream.cpp
+1
-1
No files found.
include/yaml-cpp/anchor.h
View file @
6e87b370
...
...
@@ -10,7 +10,7 @@
#include <cstddef>
namespace
YAML
{
typedef
std
::
size_t
anchor_t
;
using
anchor_t
=
std
::
size_t
;
const
anchor_t
NullAnchor
=
0
;
}
...
...
include/yaml-cpp/node/detail/bool_type.h
View file @
6e87b370
...
...
@@ -13,7 +13,7 @@ struct unspecified_bool {
struct
NOT_ALLOWED
;
static
void
true_value
(
NOT_ALLOWED
*
)
{}
};
typedef
void
(
*
unspecified_bool_type
)(
unspecified_bool
::
NOT_ALLOWED
*
);
using
unspecified_bool_type
=
void
(
*
)(
unspecified_bool
::
NOT_ALLOWED
*
);
}
}
...
...
include/yaml-cpp/node/detail/iterator.h
View file @
6e87b370
...
...
@@ -26,7 +26,7 @@ class iterator_base {
template
<
typename
>
friend
class
iterator_base
;
struct
enabler
{};
type
def
node_iterator
base_type
;
using
base_
type
=
node_iterator
;
struct
proxy
{
explicit
proxy
(
const
V
&
x
)
:
m_ref
(
x
)
{}
...
...
include/yaml-cpp/node/detail/iterator_fwd.h
View file @
6e87b370
...
...
@@ -20,8 +20,8 @@ template <typename V>
class
iterator_base
;
}
typedef
detail
::
iterator_base
<
detail
::
iterator_value
>
iterator
;
typedef
detail
::
iterator_base
<
const
detail
::
iterator_value
>
const_iterator
;
using
iterator
=
detail
::
iterator_base
<
detail
::
iterator_value
>
;
using
const_iterator
=
detail
::
iterator_base
<
const
detail
::
iterator_value
>
;
}
#endif // VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66
include/yaml-cpp/node/detail/memory.h
View file @
6e87b370
...
...
@@ -27,7 +27,7 @@ class YAML_CPP_API memory {
void
merge
(
const
memory
&
rhs
);
private:
typedef
std
::
set
<
shared_node
>
Nodes
;
using
Nodes
=
std
::
set
<
shared_node
>
;
Nodes
m_nodes
;
};
...
...
include/yaml-cpp/node/detail/node.h
View file @
6e87b370
...
...
@@ -160,7 +160,7 @@ class node {
private:
shared_node_ref
m_pRef
;
typedef
std
::
set
<
node
*>
nodes
;
using
nodes
=
std
::
set
<
node
*>
;
nodes
m_dependencies
;
};
}
// namespace detail
...
...
include/yaml-cpp/node/detail/node_data.h
View file @
6e87b370
...
...
@@ -108,17 +108,17 @@ class YAML_CPP_API node_data {
std
::
string
m_scalar
;
// sequence
typedef
std
::
vector
<
node
*>
node_seq
;
using
node_seq
=
std
::
vector
<
node
*>
;
node_seq
m_sequence
;
mutable
std
::
size_t
m_seqSize
;
// map
typedef
std
::
vector
<
std
::
pair
<
node
*
,
node
*>>
node_map
;
using
node_map
=
std
::
vector
<
std
::
pair
<
node
*
,
node
*>>
;
node_map
m_map
;
typedef
std
::
pair
<
node
*
,
node
*>
kv_pair
;
typedef
std
::
list
<
kv_pair
>
kv_pairs
;
using
kv_pair
=
std
::
pair
<
node
*
,
node
*>
;
using
kv_pairs
=
std
::
list
<
kv_pair
>
;
mutable
kv_pairs
m_undefinedPairs
;
};
}
...
...
include/yaml-cpp/node/detail/node_iterator.h
View file @
6e87b370
...
...
@@ -24,7 +24,7 @@ struct iterator_type {
template
<
typename
V
>
struct
node_iterator_value
:
public
std
::
pair
<
V
*
,
V
*>
{
typedef
std
::
pair
<
V
*
,
V
*>
kv
;
using
kv
=
std
::
pair
<
V
*
,
V
*>
;
node_iterator_value
()
:
kv
(),
pNode
(
nullptr
)
{}
explicit
node_iterator_value
(
V
&
rhs
)
:
kv
(),
pNode
(
&
rhs
)
{}
...
...
@@ -36,19 +36,19 @@ struct node_iterator_value : public std::pair<V*, V*> {
V
*
pNode
;
};
typedef
std
::
vector
<
node
*>
node_seq
;
typedef
std
::
vector
<
std
::
pair
<
node
*
,
node
*>>
node_map
;
using
node_seq
=
std
::
vector
<
node
*>
;
using
node_map
=
std
::
vector
<
std
::
pair
<
node
*
,
node
*>>
;
template
<
typename
V
>
struct
node_iterator_type
{
typedef
node_seq
::
iterator
seq
;
typedef
node_map
::
iterator
map
;
using
seq
=
node_seq
::
iterator
;
using
map
=
node_map
::
iterator
;
};
template
<
typename
V
>
struct
node_iterator_type
<
const
V
>
{
typedef
node_seq
::
const_iterator
seq
;
typedef
node_map
::
const_iterator
map
;
using
seq
=
node_seq
::
const_iterator
;
using
map
=
node_map
::
const_iterator
;
};
template
<
typename
V
>
...
...
@@ -68,9 +68,9 @@ class node_iterator_base
};
public:
typedef
typename
node_iterator_type
<
V
>::
seq
SeqIter
;
typedef
typename
node_iterator_type
<
V
>::
map
MapIter
;
type
def
node_iterator_value
<
V
>
value_type
;
using
SeqIter
=
typename
node_iterator_type
<
V
>::
seq
;
using
MapIter
=
typename
node_iterator_type
<
V
>::
map
;
using
value_
type
=
node_iterator_value
<
V
>
;
node_iterator_base
()
:
m_type
(
iterator_type
::
NoneType
),
m_seqIt
(),
m_mapIt
(),
m_mapEnd
()
{}
...
...
@@ -172,8 +172,8 @@ class node_iterator_base
MapIter
m_mapIt
,
m_mapEnd
;
};
typedef
node_iterator_base
<
node
>
node_iterator
;
typedef
node_iterator_base
<
const
node
>
const_node_iterator
;
using
node_iterator
=
node_iterator_base
<
node
>
;
using
const_node_iterator
=
node_iterator_base
<
const
node
>
;
}
}
...
...
include/yaml-cpp/node/impl.h
View file @
6e87b370
...
...
@@ -335,7 +335,7 @@ template <typename T>
struct
to_value_t
{
explicit
to_value_t
(
const
T
&
t_
)
:
t
(
t_
)
{}
const
T
&
t
;
type
def
const
T
&
return_type
;
using
return_
type
=
const
T
&
;
const
T
&
operator
()()
const
{
return
t
;
}
};
...
...
@@ -344,7 +344,7 @@ template <>
struct
to_value_t
<
const
char
*>
{
explicit
to_value_t
(
const
char
*
t_
)
:
t
(
t_
)
{}
const
char
*
t
;
typedef
std
::
str
ing
return_type
;
us
ing
return_type
=
std
::
string
;
const
std
::
string
operator
()()
const
{
return
t
;
}
};
...
...
@@ -353,7 +353,7 @@ template <>
struct
to_value_t
<
char
*>
{
explicit
to_value_t
(
char
*
t_
)
:
t
(
t_
)
{}
const
char
*
t
;
typedef
std
::
str
ing
return_type
;
us
ing
return_type
=
std
::
string
;
const
std
::
string
operator
()()
const
{
return
t
;
}
};
...
...
@@ -362,7 +362,7 @@ template <std::size_t N>
struct
to_value_t
<
char
[
N
]
>
{
explicit
to_value_t
(
const
char
*
t_
)
:
t
(
t_
)
{}
const
char
*
t
;
typedef
std
::
str
ing
return_type
;
us
ing
return_type
=
std
::
string
;
const
std
::
string
operator
()()
const
{
return
t
;
}
};
...
...
include/yaml-cpp/node/node.h
View file @
6e87b370
...
...
@@ -39,8 +39,8 @@ class YAML_CPP_API Node {
template
<
typename
T
,
typename
S
>
friend
struct
as_if
;
typedef
YAML
::
iterator
iterator
;
typedef
YAML
::
const_iterator
const_iterator
;
using
iterator
=
YAML
::
iterator
;
using
const_iterator
=
YAML
::
const_iterator
;
Node
();
explicit
Node
(
NodeType
::
value
type
);
...
...
include/yaml-cpp/node/ptr.h
View file @
6e87b370
...
...
@@ -18,11 +18,11 @@ class node_data;
class
memory
;
class
memory_holder
;
typedef
std
::
shared_ptr
<
node
>
shared_node
;
typedef
std
::
shared_ptr
<
node_ref
>
shared_node_ref
;
typedef
std
::
shared_ptr
<
node_data
>
shared_node_data
;
typedef
std
::
shared_ptr
<
memory_holder
>
shared_memory_holder
;
typedef
std
::
shared_ptr
<
memory
>
shared_memory
;
using
shared_node
=
std
::
shared_ptr
<
node
>
;
using
shared_node_ref
=
std
::
shared_ptr
<
node_ref
>
;
using
shared_node_data
=
std
::
shared_ptr
<
node_data
>
;
using
shared_memory_holder
=
std
::
shared_ptr
<
memory_holder
>
;
using
shared_memory
=
std
::
shared_ptr
<
memory
>
;
}
}
...
...
include/yaml-cpp/traits.h
View file @
6e87b370
...
...
@@ -84,7 +84,7 @@ struct is_numeric<long double> {
template
<
bool
,
class
T
=
void
>
struct
enable_if_c
{
typedef
T
type
;
using
type
=
T
;
};
template
<
class
T
>
...
...
@@ -95,7 +95,7 @@ struct enable_if : public enable_if_c<Cond::value, T> {};
template
<
bool
,
class
T
=
void
>
struct
disable_if_c
{
typedef
T
type
;
using
type
=
T
;
};
template
<
class
T
>
...
...
src/binary.cpp
View file @
6e87b370
...
...
@@ -66,7 +66,7 @@ static const unsigned char decoding[] = {
};
std
::
vector
<
unsigned
char
>
DecodeBase64
(
const
std
::
string
&
input
)
{
type
def
std
::
vector
<
unsigned
char
>
ret_type
;
using
ret_
type
=
std
::
vector
<
unsigned
char
>
;
if
(
input
.
empty
())
return
ret_type
();
...
...
src/nodebuilder.h
View file @
6e87b370
...
...
@@ -61,11 +61,11 @@ class NodeBuilder : public EventHandler {
detail
::
shared_memory_holder
m_pMemory
;
detail
::
node
*
m_pRoot
;
typedef
std
::
vector
<
detail
::
node
*>
Nodes
;
using
Nodes
=
std
::
vector
<
detail
::
node
*>
;
Nodes
m_stack
;
Nodes
m_anchors
;
typedef
std
::
pair
<
detail
::
node
*
,
bool
>
PushedKey
;
using
PushedKey
=
std
::
pair
<
detail
::
node
*
,
bool
>
;
std
::
vector
<
PushedKey
>
m_keys
;
std
::
size_t
m_mapDepth
;
};
...
...
src/nodeevents.h
View file @
6e87b370
...
...
@@ -45,7 +45,7 @@ class NodeEvents {
anchor_t
_CreateNewAnchor
()
{
return
++
m_curAnchor
;
}
private:
typedef
std
::
map
<
const
detail
::
node_ref
*
,
anchor_t
>
AnchorByIdentity
;
using
AnchorByIdentity
=
std
::
map
<
const
detail
::
node_ref
*
,
anchor_t
>
;
AnchorByIdentity
m_anchorByIdentity
;
anchor_t
m_curAnchor
;
...
...
@@ -60,7 +60,7 @@ class NodeEvents {
detail
::
shared_memory_holder
m_pMemory
;
detail
::
node
*
m_root
;
typedef
std
::
map
<
const
detail
::
node_ref
*
,
int
>
RefCount
;
using
RefCount
=
std
::
map
<
const
detail
::
node_ref
*
,
int
>
;
RefCount
m_refCount
;
};
}
// namespace YAML
...
...
src/setting.h
View file @
6e87b370
...
...
@@ -95,7 +95,7 @@ class SettingChanges {
}
private:
typedef
std
::
vector
<
std
::
unique_ptr
<
SettingChangeBase
>>
setting_changes
;
using
setting_changes
=
std
::
vector
<
std
::
unique_ptr
<
SettingChangeBase
>
>
;
setting_changes
m_settingChanges
;
};
}
// namespace YAML
...
...
src/singledocparser.h
View file @
6e87b370
...
...
@@ -59,7 +59,7 @@ class SingleDocParser {
const
Directives
&
m_directives
;
std
::
unique_ptr
<
CollectionStack
>
m_pCollectionStack
;
typedef
std
::
map
<
std
::
string
,
anchor_t
>
Anchors
;
using
Anchors
=
std
::
map
<
std
::
string
,
anchor_t
>
;
Anchors
m_anchors
;
anchor_t
m_curAnchor
;
...
...
src/stream.cpp
View file @
6e87b370
...
...
@@ -189,7 +189,7 @@ Stream::Stream(std::istream& input)
m_pPrefetched
(
new
unsigned
char
[
YAML_PREFETCH_SIZE
]),
m_nPrefetchedAvailable
(
0
),
m_nPrefetchedUsed
(
0
)
{
typedef
std
::
istream
::
traits_type
char_traits
;
using
char_traits
=
std
::
istream
::
traits_type
;
if
(
!
input
)
return
;
...
...
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