Improve and simplify code with modern C++ features
Change-Id: I28d84df3087492ab2ecbeb91169a2cde12c9e31e
diff --git a/src/encoding/tlv.hpp b/src/encoding/tlv.hpp
index fc664c6..6a14a7c 100644
--- a/src/encoding/tlv.hpp
+++ b/src/encoding/tlv.hpp
@@ -354,7 +354,7 @@
* common ContiguousIterator types used with TLV decoding function templates.
*/
template<typename Iterator,
- typename DecayedIterator = typename std::decay<Iterator>::type,
+ typename DecayedIterator = std::decay_t<Iterator>,
typename ValueType = typename std::iterator_traits<DecayedIterator>::value_type>
constexpr bool
shouldSelectContiguousReadNumber()
@@ -367,8 +367,8 @@
}
template<typename Iterator>
-class ReadNumber : public std::conditional<shouldSelectContiguousReadNumber<Iterator>(),
- ReadNumberFast<Iterator>, ReadNumberSlow<Iterator>>::type
+class ReadNumber : public std::conditional_t<shouldSelectContiguousReadNumber<Iterator>(),
+ ReadNumberFast<Iterator>, ReadNumberSlow<Iterator>>
{
};