Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
d10328d8
Commit
d10328d8
authored
Jan 25, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the zeep implementation of std::experimental::is_detected
parent
e418a172
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
60 deletions
+8
-60
CMakeLists.txt
+6
-0
include/cif++/text.hpp
+2
-60
No files found.
CMakeLists.txt
View file @
d10328d8
...
@@ -173,6 +173,12 @@ list(APPEND CIFPP_REQUIRED_LIBRARIES ${STDCPPFS_LIBRARY})
...
@@ -173,6 +173,12 @@ list(APPEND CIFPP_REQUIRED_LIBRARIES ${STDCPPFS_LIBRARY})
include
(
FindAtomic
)
include
(
FindAtomic
)
list
(
APPEND CIFPP_REQUIRED_LIBRARIES
${
STDCPPATOMIC_LIBRARY
}
)
list
(
APPEND CIFPP_REQUIRED_LIBRARIES
${
STDCPPATOMIC_LIBRARY
}
)
if
(
MSVC
)
# this dependency can go once MSVC supports std::experimental::is_detected
find_package
(
zeep 5.1.8 REQUIRED
)
list
(
APPEND CIFPP_REQUIRED_LIBRARIES zeep::zeep
)
endif
()
# Create a revision file, containing the current git version info
# Create a revision file, containing the current git version info
include
(
VersionString
)
include
(
VersionString
)
write_version_header
(
${
PROJECT_SOURCE_DIR
}
/src/
"LibCIFPP"
)
write_version_header
(
${
PROJECT_SOURCE_DIR
}
/src/
"LibCIFPP"
)
...
...
include/cif++/text.hpp
View file @
d10328d8
...
@@ -39,66 +39,8 @@
...
@@ -39,66 +39,8 @@
#if __has_include(<experimental/type_traits>)
#if __has_include(<experimental/type_traits>)
#include <experimental/type_traits>
#include <experimental/type_traits>
#else
#else
#include <type_traits>
// sub optimal, but replicating the same code is worse
#endif
#include <zeep/type-traits.hpp>
#if (not defined(__cpp_lib_experimental_detect) or (__cpp_lib_experimental_detect < 201505)) and (not defined(_LIBCPP_VERSION) or _LIBCPP_VERSION < 5000)
// This code is copied from:
// https://ld2015.scusa.lsu.edu/cppreference/en/cpp/experimental/is_detected.html
namespace
std
{
template
<
class
...
>
using
void_t
=
void
;
namespace
experimental
{
namespace
detail
{
template
<
class
Default
,
class
AlwaysVoid
,
template
<
class
...
>
class
Op
,
class
...
Args
>
struct
detector
{
using
value_t
=
false_type
;
using
type
=
Default
;
};
template
<
class
Default
,
template
<
class
...
>
class
Op
,
class
...
Args
>
struct
detector
<
Default
,
void_t
<
Op
<
Args
...
>>
,
Op
,
Args
...
>
{
// Note that std::void_t is a c++17 feature
using
value_t
=
true_type
;
using
type
=
Op
<
Args
...
>
;
};
}
// namespace detail
struct
nonesuch
{
nonesuch
()
=
delete
;
~
nonesuch
()
=
delete
;
nonesuch
(
nonesuch
const
&
)
=
delete
;
void
operator
=
(
nonesuch
const
&
)
=
delete
;
};
template
<
template
<
class
...
>
class
Op
,
class
...
Args
>
using
is_detected
=
typename
detail
::
detector
<
nonesuch
,
void
,
Op
,
Args
...
>::
value_t
;
template
<
template
<
class
...
>
class
Op
,
class
...
Args
>
constexpr
inline
bool
is_detected_v
=
is_detected
<
Op
,
Args
...
>::
value
;
template
<
template
<
class
...
>
class
Op
,
class
...
Args
>
using
detected_t
=
typename
detail
::
detector
<
nonesuch
,
void
,
Op
,
Args
...
>::
type
;
template
<
class
Default
,
template
<
class
...
>
class
Op
,
class
...
Args
>
using
detected_or
=
detail
::
detector
<
Default
,
void
,
Op
,
Args
...
>
;
template
<
class
Expected
,
template
<
class
...
>
class
Op
,
class
...
Args
>
using
is_detected_exact
=
std
::
is_same
<
Expected
,
detected_t
<
Op
,
Args
...
>>
;
template
<
class
Expected
,
template
<
class
...
>
class
Op
,
class
...
Args
>
constexpr
inline
bool
is_detected_exact_v
=
is_detected_exact
<
Expected
,
Op
,
Args
...
>::
value
;
}
}
#endif
#endif
namespace
cif
namespace
cif
...
...
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