|
|
|||
File indexing completed on 2025-12-15 09:53:03
0001 /*! 0002 @file 0003 Forward declares `boost::hana::fill`. 0004 0005 Copyright Louis Dionne 2013-2022 0006 Distributed under the Boost Software License, Version 1.0. 0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 0008 */ 0009 0010 #ifndef BOOST_HANA_FWD_FILL_HPP 0011 #define BOOST_HANA_FWD_FILL_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 #include <boost/hana/core/when.hpp> 0015 0016 0017 namespace boost { namespace hana { 0018 //! Replace all the elements of a structure with a fixed value. 0019 //! @ingroup group-Functor 0020 //! 0021 //! 0022 //! Signature 0023 //! --------- 0024 //! Given `F` a Functor, the signature is 0025 //! \f$ 0026 //! \mathtt{fill} : F(T) \times U \to F(U) 0027 //! \f$ 0028 //! 0029 //! @param xs 0030 //! The structure to fill with a `value`. 0031 //! 0032 //! @param value 0033 //! A value by which every element `x` of the structure is replaced, 0034 //! unconditionally. 0035 //! 0036 //! 0037 //! Example 0038 //! ------- 0039 //! @include example/fill.cpp 0040 #ifdef BOOST_HANA_DOXYGEN_INVOKED 0041 constexpr auto fill = [](auto&& xs, auto&& value) { 0042 return tag-dispatched; 0043 }; 0044 #else 0045 template <typename Xs, typename = void> 0046 struct fill_impl : fill_impl<Xs, when<true>> { }; 0047 0048 struct fill_t { 0049 template <typename Xs, typename Value> 0050 constexpr auto operator()(Xs&& xs, Value&& value) const; 0051 }; 0052 0053 BOOST_HANA_INLINE_VARIABLE constexpr fill_t fill{}; 0054 #endif 0055 }} // end namespace boost::hana 0056 0057 #endif // !BOOST_HANA_FWD_FILL_HPP
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|