diff options
author | 2016-03-05 14:41:30 +0100 | |
---|---|---|
committer | 2016-03-05 14:41:42 +0100 | |
commit | 4a876eab0eaea8f68e9634976f9aaea53a7cd12f (patch) | |
tree | 2e14ec242e5fca812473c51712d03f36ed11d8d7 | |
parent | 63fb72684a5f011feb1c35b0829700aa79848495 (diff) |
This works (nw)
-rw-r--r-- | 3rdparty/compat_cpp14.h | 65 | ||||
-rw-r--r-- | src/emu/emu.h | 2 | ||||
-rw-r--r-- | src/lib/util/strformat.h | 15 |
3 files changed, 15 insertions, 67 deletions
diff --git a/3rdparty/compat_cpp14.h b/3rdparty/compat_cpp14.h deleted file mode 100644 index 6f7ea71885a..00000000000 --- a/3rdparty/compat_cpp14.h +++ /dev/null @@ -1,65 +0,0 @@ -// Ville Voutilainen code from include/bits/range_access.h from libstdc++ - -#if defined(__GNUC__) && ((__GNUC__ == 5 && __GNUC_MINOR__ < 2) || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)) - -template<class _Container> - inline constexpr auto - cbegin(const _Container& __cont) noexcept(noexcept(std::begin(__cont)))-> decltype(std::begin(__cont)) - { return std::begin(__cont); } - -template<class _Container> - inline constexpr auto - cend(const _Container& __cont) noexcept(noexcept(std::end(__cont)))-> decltype(std::end(__cont)) - { return std::end(__cont); } - -template<class _Container> - inline auto - rbegin(_Container& __cont) -> decltype(__cont.rbegin()) - { return __cont.rbegin(); } - -template<class _Container> - inline auto - rbegin(const _Container& __cont) -> decltype(__cont.rbegin()) - { return __cont.rbegin(); } - -template<class _Container> - inline auto - rend(_Container& __cont) -> decltype(__cont.rend()) - { return __cont.rend(); } - -template<class _Container> - inline auto - rend(const _Container& __cont) -> decltype(__cont.rend()) - { return __cont.rend(); } - -template<class _Tp, size_t _Nm> - inline reverse_iterator<_Tp*> - rbegin(_Tp (&__arr)[_Nm]) - { return reverse_iterator<_Tp*>(__arr + _Nm); } - -template<class _Tp, size_t _Nm> - inline reverse_iterator<_Tp*> - rend(_Tp (&__arr)[_Nm]) - { return reverse_iterator<_Tp*>(__arr); } - -template<class _Tp> - inline reverse_iterator<const _Tp*> - rbegin(initializer_list<_Tp> __il) - { return reverse_iterator<const _Tp*>(__il.end()); } - -template<class _Tp> - inline reverse_iterator<const _Tp*> - rend(initializer_list<_Tp> __il) - { return reverse_iterator<const _Tp*>(__il.begin()); } - -template<class _Container> - inline auto - crbegin(const _Container& __cont) -> decltype(std::rbegin(__cont)) - { return std::rbegin(__cont); } - -template<class _Container> - inline auto - crend(const _Container& __cont) -> decltype(std::rend(__cont)) - { return std::rend(__cont); } - -#endif
\ No newline at end of file diff --git a/src/emu/emu.h b/src/emu/emu.h index afea75e477f..0cf7b7c1384 100644 --- a/src/emu/emu.h +++ b/src/emu/emu.h @@ -25,8 +25,6 @@ #include <unordered_map> #include <unordered_set> -#include "compat_cpp14.h" - // core emulator headers -- must be first #include "emucore.h" #include "eminline.h" diff --git a/src/lib/util/strformat.h b/src/lib/util/strformat.h index 51d521fd25b..dc8061ca944 100644 --- a/src/lib/util/strformat.h +++ b/src/lib/util/strformat.h @@ -185,6 +185,21 @@ #include <type_traits> #include <utility> +#if defined(__GNUC__) && ((__GNUC__ == 5 && __GNUC_MINOR__ < 2) || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)) +namespace std +{ +template<class _Container> + inline constexpr auto + cbegin(const _Container& __cont) noexcept(noexcept(std::begin(__cont)))-> decltype(std::begin(__cont)) + { return std::begin(__cont); } + +template<class _Container> + inline constexpr auto + cend(const _Container& __cont) noexcept(noexcept(std::end(__cont)))-> decltype(std::end(__cont)) + { return std::end(__cont); } +} +#endif + namespace util { namespace detail { //************************************************************************** |