diff options
author | Jacques Lucke <jacques@blender.org> | 2021-12-27 18:08:11 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-12-27 18:08:11 +0300 |
commit | 51a131ddbc2eeebd13cdc6a71b2d356267fda73e (patch) | |
tree | f85e2e4f2f809e0ebba5876428a1d07ed6ea20cc /source/blender/blenlib/BLI_virtual_array.hh | |
parent | 594438ef0d6135a5bbf9101292db9f2d3aca9312 (diff) |
BLI: add utility to check if type is any specific type
This adds `blender::is_same_any_v` which is the almost the same as
`std::is_same_v`. The difference is that it allows for checking multiple
types at the same time.
Differential Revision: https://developer.blender.org/D13673
Diffstat (limited to 'source/blender/blenlib/BLI_virtual_array.hh')
-rw-r--r-- | source/blender/blenlib/BLI_virtual_array.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_virtual_array.hh b/source/blender/blenlib/BLI_virtual_array.hh index 3ed9f14712e..86ac95e2c77 100644 --- a/source/blender/blenlib/BLI_virtual_array.hh +++ b/source/blender/blenlib/BLI_virtual_array.hh @@ -477,9 +477,9 @@ template<typename T> struct VArrayAnyExtraInfo { template<typename StorageT> static VArrayAnyExtraInfo get() { /* These are the only allowed types in the #Any. */ - static_assert(std::is_base_of_v<VArrayImpl<T>, StorageT> || - std::is_same_v<StorageT, const VArrayImpl<T> *> || - std::is_same_v<StorageT, std::shared_ptr<const VArrayImpl<T>>>); + static_assert( + std::is_base_of_v<VArrayImpl<T>, StorageT> || + is_same_any_v<StorageT, const VArrayImpl<T> *, std::shared_ptr<const VArrayImpl<T>>>); /* Depending on how the virtual array implementation is stored in the #Any, a different * #get_varray function is required. */ |