projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7be37ad
)
Add RemoveConstReference metaprogamming struct
author
Mikko Rasa
<tdb@tdb.fi>
Fri, 27 Sep 2019 00:05:07 +0000
(
03:05
+0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Fri, 27 Sep 2019 00:05:07 +0000
(
03:05
+0300)
It combines RemoveConst and RemoveReference but is much shorter
source/core/meta.h
patch
|
blob
|
history
diff --git
a/source/core/meta.h
b/source/core/meta.h
index d6ca35935543049d8026b842ecca40785a92ecae..8015f42370837e2ba6633acb0ee9b50a87ca9273 100644
(file)
--- a/
source/core/meta.h
+++ b/
source/core/meta.h
@@
-23,6
+23,11
@@
struct RemoveReference<T &>
{ typedef T Type; };
+template<typename T>
+struct RemoveConstReference
+{ typedef typename RemoveConst<typename RemoveReference<T>::Type>::Type Type; };
+
+
template<bool c, typename R>
struct EnableIf;