Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
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
lvzhengyang
yaml-cpp
Commits
84809112
Commit
84809112
authored
Oct 02, 2019
by
Andy Maloney
Committed by
Jesse Beder
Oct 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace node's YAML_CPP_OPERATOR_BOOL macro with an explicit bool operator (#755)
parent
6e87b370
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
28 deletions
+1
-28
include/yaml-cpp/node/detail/bool_type.h
+0
-26
include/yaml-cpp/node/node.h
+1
-2
No files found.
include/yaml-cpp/node/detail/bool_type.h
deleted
100644 → 0
View file @
6e87b370
#ifndef NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#if defined(_MSC_VER) || \
(defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
(__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
#pragma once
#endif
namespace
YAML
{
namespace
detail
{
struct
unspecified_bool
{
struct
NOT_ALLOWED
;
static
void
true_value
(
NOT_ALLOWED
*
)
{}
};
using
unspecified_bool_type
=
void
(
*
)(
unspecified_bool
::
NOT_ALLOWED
*
);
}
}
#define YAML_CPP_OPERATOR_BOOL() \
operator YAML::detail::unspecified_bool_type() const { \
return this->operator!() ? 0 \
: &YAML::detail::unspecified_bool::true_value; \
}
#endif // NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
include/yaml-cpp/node/node.h
View file @
84809112
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include "yaml-cpp/dll.h"
#include "yaml-cpp/dll.h"
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/mark.h"
#include "yaml-cpp/mark.h"
#include "yaml-cpp/node/detail/bool_type.h"
#include "yaml-cpp/node/detail/iterator_fwd.h"
#include "yaml-cpp/node/detail/iterator_fwd.h"
#include "yaml-cpp/node/ptr.h"
#include "yaml-cpp/node/ptr.h"
#include "yaml-cpp/node/type.h"
#include "yaml-cpp/node/type.h"
...
@@ -59,7 +58,7 @@ class YAML_CPP_API Node {
...
@@ -59,7 +58,7 @@ class YAML_CPP_API Node {
bool
IsMap
()
const
{
return
Type
()
==
NodeType
::
Map
;
}
bool
IsMap
()
const
{
return
Type
()
==
NodeType
::
Map
;
}
// bool conversions
// bool conversions
YAML_CPP_OPERATOR_BOOL
()
explicit
operator
bool
()
const
{
return
IsDefined
();
}
bool
operator
!
()
const
{
return
!
IsDefined
();
}
bool
operator
!
()
const
{
return
!
IsDefined
();
}
// access
// access
...
...
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