Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:29

0001 /*
0002 Copyright 2019 Glen Joseph Fernandes
0003 (glenjofe@gmail.com)
0004 
0005 Distributed under the Boost Software License, Version 1.0.
0006 (http://www.boost.org/LICENSE_1_0.txt)
0007 */
0008 #ifndef BOOST_CORE_FIRST_SCALAR_HPP
0009 #define BOOST_CORE_FIRST_SCALAR_HPP
0010 
0011 #include <boost/config.hpp>
0012 #include <cstddef>
0013 
0014 namespace boost {
0015 namespace detail {
0016 
0017 template<class T>
0018 struct make_scalar {
0019     typedef T type;
0020 };
0021 
0022 template<class T, std::size_t N>
0023 struct make_scalar<T[N]> {
0024     typedef typename make_scalar<T>::type type;
0025 };
0026 
0027 } /* detail */
0028 
0029 template<class T>
0030 BOOST_CONSTEXPR inline T*
0031 first_scalar(T* p) BOOST_NOEXCEPT
0032 {
0033     return p;
0034 }
0035 
0036 template<class T, std::size_t N>
0037 BOOST_CONSTEXPR inline typename detail::make_scalar<T>::type*
0038 first_scalar(T (*p)[N]) BOOST_NOEXCEPT
0039 {
0040     return boost::first_scalar(&(*p)[0]);
0041 }
0042 
0043 } /* boost */
0044 
0045 #endif