diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2016-08-04 19:01:10 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2016-08-04 19:01:10 +0000 |
| commit | fa70c0e286d268ef3e35f2d08a0404dcbf02caa3 (patch) | |
| tree | 97740938a795425b35d93e34ab938215d593d5b6 /src | |
| parent | Require C++11 (diff) | |
| download | inkscape-fa70c0e286d268ef3e35f2d08a0404dcbf02caa3.tar.gz inkscape-fa70c0e286d268ef3e35f2d08a0404dcbf02caa3.zip | |
Use C++11 unordered containers
(bzr r15040)
Diffstat (limited to 'src')
| -rw-r--r-- | src/util/unordered-containers.h | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/src/util/unordered-containers.h b/src/util/unordered-containers.h index b92f2e7ea..0bda8191f 100644 --- a/src/util/unordered-containers.h +++ b/src/util/unordered-containers.h @@ -20,12 +20,11 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#if defined(HAVE_NATIVE_UNORDERED_SET) -# include <unordered_set> -# include <unordered_map> -# define INK_UNORDERED_SET std::unordered_set -# define INK_UNORDERED_MAP std::unordered_map -# define INK_HASH std::hash +#include <unordered_set> +#include <unordered_map> +#define INK_UNORDERED_SET std::unordered_set +#define INK_UNORDERED_MAP std::unordered_map +#define INK_HASH std::hash namespace std { template <> @@ -36,41 +35,6 @@ struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size }; } // namespace std -#elif defined(HAVE_TR1_UNORDERED_SET) -# include <tr1/unordered_set> -# include <tr1/unordered_map> -# define INK_UNORDERED_SET std::tr1::unordered_set -# define INK_UNORDERED_MAP std::tr1::unordered_map -# define INK_HASH std::tr1::hash - -namespace std { -namespace tr1 { -template <> -struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size_t> { - std::size_t operator()(Glib::ustring const &s) const { - return hash<std::string>()(s.raw()); - } -}; -} // namespace tr1 -} // namespace std - -#elif defined(HAVE_BOOST_UNORDERED_SET) -# include <boost/unordered_set.hpp> -# include <boost/unordered_map.hpp> -# define INK_UNORDERED_SET boost::unordered_set -# define INK_UNORDERED_MAP boost::unordered_map -# define INK_HASH boost::hash - -namespace boost { -template <> -struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size_t> { - std::size_t operator()(Glib::ustring const &s) const { - return hash<std::string>()(s.raw()); - } -}; -} // namespace boost -#endif - #else /// Name (with namespace) of the unordered set template. #define INK_UNORDERED_SET |
