summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/utility.hpp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-08-26 03:02:29 +0000
committerNorbert Preining <norbert@preining.info>2021-08-26 03:02:29 +0000
commit059cab71c68a3fbee36f60e8208d4a47d11c6b60 (patch)
treec982bcbf00c931a1474d68bf51dfeba5918cf76c /dviware/dvisvgm/src/utility.hpp
parent960421b0bcd1af561be3f2eb9468224969a7bd34 (diff)
CTAN sync 202108260302
Diffstat (limited to 'dviware/dvisvgm/src/utility.hpp')
-rw-r--r--dviware/dvisvgm/src/utility.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/dviware/dvisvgm/src/utility.hpp b/dviware/dvisvgm/src/utility.hpp
index 7ad3bc8d69..275da3cc3a 100644
--- a/dviware/dvisvgm/src/utility.hpp
+++ b/dviware/dvisvgm/src/utility.hpp
@@ -2,7 +2,7 @@
** utility.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2021 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -25,6 +25,7 @@
#include <memory>
#include <sstream>
#include <string>
+#include <type_traits>
#include <vector>
namespace math {
@@ -145,6 +146,17 @@ std::unique_ptr<T> static_unique_ptr_cast (std::unique_ptr<U> &&old){
return std::unique_ptr<T>{static_cast<T*>(old.release())};
}
+template <typename T>
+struct set_const_of {
+ template <typename U>
+ struct by {
+ using type = typename std::conditional<
+ std::is_const<U>::value,
+ typename std::add_const<T>::type,
+ typename std::remove_const<T>::type
+ >::type;
+ };
+};
} // namespace util
#endif