diff options
author | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-12-24 20:52:58 (GMT) |
---|---|---|
committer | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-12-27 21:29:06 (GMT) |
commit | 70e245f19ec8e753784db6a1153c64e5f5eec16a (patch) | |
tree | 988016d3f66fa6227636d706ddddd02bae673278 /Source | |
parent | 6d3765236852935f5ef312e4b417be4470fbed1f (diff) | |
download | CMake-70e245f19ec8e753784db6a1153c64e5f5eec16a.zip CMake-70e245f19ec8e753784db6a1153c64e5f5eec16a.tar.gz CMake-70e245f19ec8e753784db6a1153c64e5f5eec16a.tar.bz2 |
cmAlgorithms: add utility functions to get signed size of containers
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAlgorithms.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index bbd3e8e..2f8e675 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -396,6 +396,12 @@ constexpr #endif +template <typename T> +int isize(const T& t) +{ + return static_cast<int>(cm::size(t)); +} + #if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L using std::cbegin; |