From 8fa1bd17166f09d8de747e76149e5d199ebda468 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 19 Oct 2016 20:53:13 +0100 Subject: Rename to avoid conflicts --- libadhocutil/optionalUtils.h | 30 ++++++++++++++++++++++++++++++ libadhocutil/optionals.h | 30 ------------------------------ libadhocutil/unittests/testOptionals.cpp | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 libadhocutil/optionalUtils.h delete mode 100644 libadhocutil/optionals.h diff --git a/libadhocutil/optionalUtils.h b/libadhocutil/optionalUtils.h new file mode 100644 index 0000000..f4d6b1a --- /dev/null +++ b/libadhocutil/optionalUtils.h @@ -0,0 +1,30 @@ +#ifndef ADHOCUTIL_OPTIONALS_H +#define ADHOCUTIL_OPTIONALS_H + +#include + +namespace AdHoc { + template + auto + operator/(const A & a, const B & b) -> typename std::enable_if< + std::is_constructible::value && + !std::is_pointer::value && + std::is_convertible::value, + decltype(a ? *a : b)>::type + { + return (a ? *a : b); + } + + template + auto + operator/(const A & a, const B & b) -> typename std::enable_if< + std::is_constructible::value && + std::is_pointer::value, + decltype(a ? &*a : b)>::type + { + return (a ? &*a : b); + } +} + +#endif + diff --git a/libadhocutil/optionals.h b/libadhocutil/optionals.h deleted file mode 100644 index f4d6b1a..0000000 --- a/libadhocutil/optionals.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ADHOCUTIL_OPTIONALS_H -#define ADHOCUTIL_OPTIONALS_H - -#include - -namespace AdHoc { - template - auto - operator/(const A & a, const B & b) -> typename std::enable_if< - std::is_constructible::value && - !std::is_pointer::value && - std::is_convertible::value, - decltype(a ? *a : b)>::type - { - return (a ? *a : b); - } - - template - auto - operator/(const A & a, const B & b) -> typename std::enable_if< - std::is_constructible::value && - std::is_pointer::value, - decltype(a ? &*a : b)>::type - { - return (a ? &*a : b); - } -} - -#endif - diff --git a/libadhocutil/unittests/testOptionals.cpp b/libadhocutil/unittests/testOptionals.cpp index 7e5b4b1..f97b37b 100644 --- a/libadhocutil/unittests/testOptionals.cpp +++ b/libadhocutil/unittests/testOptionals.cpp @@ -1,7 +1,7 @@ #define BOOST_TEST_MODULE Buffer #include -#include +#include #include #include #include -- cgit v1.2.3