summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-10-18 22:53:43 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-10-18 23:26:26 +0000
commitddffc1a8ab9e3357a8e0350ff08b5ef1a9fb2651 (patch)
tree9c91b6224ee6af12f030f03635f52b654db59840 /src/util
parentMerge branch 'bugfix-1789838-confirmation-needed-before-overwriting-template'... (diff)
downloadinkscape-ddffc1a8ab9e3357a8e0350ff08b5ef1a9fb2651.tar.gz
inkscape-ddffc1a8ab9e3357a8e0350ff08b5ef1a9fb2651.zip
Remove util/unordered-containers.h aliases.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/CMakeLists.txt1
-rw-r--r--src/util/units.cpp5
-rw-r--r--src/util/units.h20
-rw-r--r--src/util/unordered-containers.h54
4 files changed, 19 insertions, 61 deletions
diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt
index b8c61e2fe..ce982eab3 100644
--- a/src/util/CMakeLists.txt
+++ b/src/util/CMakeLists.txt
@@ -35,7 +35,6 @@ set(util_SRC
tuple.h
ucompose.hpp
units.h
- unordered-containers.h
ziptool.h
)
diff --git a/src/util/units.cpp b/src/util/units.cpp
index 35493bcbc..0308623d5 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -14,6 +14,7 @@
#include <iomanip>
#include <iostream>
#include <utility>
+#include <unordered_map>
#include <glib.h>
#include <glibmm/regex.h>
#include <glibmm/fileutils.h>
@@ -81,7 +82,7 @@ unsigned const svg_length_lookup[] = {
// maps unit codes obtained from their abbreviations to their SVGLength unit indexes
-typedef INK_UNORDERED_MAP<unsigned, SVGLength::Unit> UnitCodeLookup;
+typedef std::unordered_map<unsigned, SVGLength::Unit> UnitCodeLookup;
UnitCodeLookup make_unit_code_lookup()
{
@@ -96,7 +97,7 @@ UnitCodeLookup const unit_code_lookup = make_unit_code_lookup();
-typedef INK_UNORDERED_MAP<Glib::ustring, Inkscape::Util::UnitType> TypeMap;
+typedef std::unordered_map<Glib::ustring, Inkscape::Util::UnitType> TypeMap;
/** A std::map that gives the data type value for the string version.
* @todo consider hiding map behind hasFoo() and getFoo() type functions. */
diff --git a/src/util/units.h b/src/util/units.h
index e4530d0c3..17c54eb4e 100644
--- a/src/util/units.h
+++ b/src/util/units.h
@@ -13,12 +13,24 @@
#ifndef INKSCAPE_UTIL_UNITS_H
#define INKSCAPE_UTIL_UNITS_H
-#include <map>
+#include <unordered_map>
#include <boost/operators.hpp>
#include <glibmm/ustring.h>
#include <2geom/coord.h>
#include "svg/svg-length.h"
-#include "unordered-containers.h"
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+namespace std {
+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 std
+
+#endif
namespace Inkscape {
namespace Util {
@@ -137,8 +149,8 @@ public:
UnitTable();
virtual ~UnitTable();
- typedef INK_UNORDERED_MAP<Glib::ustring, Unit> UnitMap;
- typedef INK_UNORDERED_MAP<unsigned, Unit*> UnitCodeMap;
+ typedef std::unordered_map<Glib::ustring, Unit> UnitMap;
+ typedef std::unordered_map<unsigned, Unit*> UnitCodeMap;
/** Add a new unit to the table */
void addUnit(Unit const &u, bool primary);
diff --git a/src/util/unordered-containers.h b/src/util/unordered-containers.h
deleted file mode 100644
index 9d869142d..000000000
--- a/src/util/unordered-containers.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- * @brief Compatibility wrapper for unordered containers.
- */
-/* Authors:
- * Jon A. Cruz <jon@joncruz.org>
- * Krzysztof KosiƄski <tweenk.pl@gmail.com>
- *
- * Copyright (C) 2010 Authors
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#ifndef SEEN_INK_UTIL_UNORDERED_CONTAINERS_H
-#define SEEN_INK_UTIL_UNORDERED_CONTAINERS_H
-
-#include <glibmm/ustring.h>
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#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 <>
-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 std
-
-#else
-/// Name (with namespace) of the unordered set template.
-#define INK_UNORDERED_SET
-/// Name (with namespace) of the unordered map template.
-#define INK_UNORDERED_MAP
-/// Name (with namespace) of the hash template.
-#define INK_HASH
-
-#endif
-
-#endif // SEEN_SET_TYPES_H
-/*
- Local Variables:
- mode:c++
- c-file-style:"stroustrup"
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
- indent-tabs-mode:nil
- fill-column:99
- End:
-*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :