aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbeinhaerter <34543625+beinhaerter@users.noreply.github.com>2018-02-23 22:35:36 +0100
committerNeil MacIntosh <neilmac@fb.com>2018-02-23 13:35:36 -0800
commit7eb8f41af544941c712916dc0cb2c6c6ef7768ac (patch)
tree9bd455b8732a097f58785644bd6ba90090443c08 /include
parentb3870ca02077ac39a306478ae6259124e46b8d9f (diff)
downloadplatform_external_Microsoft-GSL-7eb8f41af544941c712916dc0cb2c6c6ef7768ac.tar.gz
platform_external_Microsoft-GSL-7eb8f41af544941c712916dc0cb2c6c6ef7768ac.tar.bz2
platform_external_Microsoft-GSL-7eb8f41af544941c712916dc0cb2c6c6ef7768ac.zip
constexpr for make_span (#627)
Diffstat (limited to 'include')
-rw-r--r--include/gsl/span14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/gsl/span b/include/gsl/span
index 9d67fb6..36c8a8b 100644
--- a/include/gsl/span
+++ b/include/gsl/span
@@ -619,43 +619,43 @@ as_writeable_bytes(span<ElementType, Extent> s) GSL_NOEXCEPT
// make_span() - Utility functions for creating spans
//
template <class ElementType>
-span<ElementType> make_span(ElementType* ptr, typename span<ElementType>::index_type count)
+constexpr span<ElementType> make_span(ElementType* ptr, typename span<ElementType>::index_type count)
{
return span<ElementType>(ptr, count);
}
template <class ElementType>
-span<ElementType> make_span(ElementType* firstElem, ElementType* lastElem)
+constexpr span<ElementType> make_span(ElementType* firstElem, ElementType* lastElem)
{
return span<ElementType>(firstElem, lastElem);
}
template <class ElementType, std::size_t N>
-span<ElementType, N> make_span(ElementType (&arr)[N])
+constexpr span<ElementType, N> make_span(ElementType (&arr)[N])
{
return span<ElementType, N>(arr);
}
template <class Container>
-span<typename Container::value_type> make_span(Container& cont)
+constexpr span<typename Container::value_type> make_span(Container& cont)
{
return span<typename Container::value_type>(cont);
}
template <class Container>
-span<const typename Container::value_type> make_span(const Container& cont)
+constexpr span<const typename Container::value_type> make_span(const Container& cont)
{
return span<const typename Container::value_type>(cont);
}
template <class Ptr>
-span<typename Ptr::element_type> make_span(Ptr& cont, std::ptrdiff_t count)
+constexpr span<typename Ptr::element_type> make_span(Ptr& cont, std::ptrdiff_t count)
{
return span<typename Ptr::element_type>(cont, count);
}
template <class Ptr>
-span<typename Ptr::element_type> make_span(Ptr& cont)
+constexpr span<typename Ptr::element_type> make_span(Ptr& cont)
{
return span<typename Ptr::element_type>(cont);
}