From 66809c6852a0250243db893ab5460bfdace063c4 Mon Sep 17 00:00:00 2001 From: Ian Taylor Date: Thu, 6 Jun 2019 17:16:08 -0400 Subject: [PATCH] make TypeListIndexer constexpr (#733) --- include/gsl/multi_span | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/gsl/multi_span b/include/gsl/multi_span index f1a909e..0c1506e 100644 --- a/include/gsl/multi_span +++ b/include/gsl/multi_span @@ -518,31 +518,31 @@ namespace details struct TypeListIndexer { const TypeChain& obj_; - TypeListIndexer(const TypeChain& obj) : obj_(obj) {} + constexpr TypeListIndexer(const TypeChain& obj) : obj_(obj) {} template - const TypeChain& getObj(std::true_type) + constexpr const TypeChain& getObj(std::true_type) { return obj_; } template - auto getObj(std::false_type) + constexpr auto getObj(std::false_type) -> decltype(TypeListIndexer(static_cast(obj_)).template get()) { return TypeListIndexer(static_cast(obj_)).template get(); } template - auto get() -> decltype(getObj(std::integral_constant())) + constexpr auto get() -> decltype(getObj(std::integral_constant())) { return getObj(std::integral_constant()); } }; template - TypeListIndexer createTypeListIndexer(const TypeChain& obj) + constexpr TypeListIndexer createTypeListIndexer(const TypeChain& obj) { return TypeListIndexer(obj); }