summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/utility.hpp
diff options
context:
space:
mode:
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