|
|
|||
File indexing completed on 2025-12-15 09:53:04
0001 /*! 0002 @file 0003 Forward declares `boost::hana::for_each`. 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_FOR_EACH_HPP 0011 #define BOOST_HANA_FWD_FOR_EACH_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 #include <boost/hana/core/when.hpp> 0015 0016 0017 namespace boost { namespace hana { 0018 //! Perform an action on each element of a foldable, discarding 0019 //! the result each time. 0020 //! @ingroup group-Foldable 0021 //! 0022 //! Iteration is done from left to right, i.e. in the same order as when 0023 //! using `fold_left`. If the structure is not finite, this method will 0024 //! not terminate. 0025 //! 0026 //! 0027 //! @param xs 0028 //! The structure to iterate over. 0029 //! 0030 //! @param f 0031 //! A function called as `f(x)` for each element `x` of the structure. 0032 //! The result of `f(x)`, whatever it is, is ignored. 0033 //! 0034 //! 0035 //! Example 0036 //! ------- 0037 //! @include example/for_each.cpp 0038 #ifdef BOOST_HANA_DOXYGEN_INVOKED 0039 constexpr auto for_each = [](auto&& xs, auto&& f) -> void { 0040 tag-dispatched; 0041 }; 0042 #else 0043 template <typename T, typename = void> 0044 struct for_each_impl : for_each_impl<T, when<true>> { }; 0045 0046 struct for_each_t { 0047 template <typename Xs, typename F> 0048 constexpr void operator()(Xs&& xs, F&& f) const; 0049 }; 0050 0051 BOOST_HANA_INLINE_VARIABLE constexpr for_each_t for_each{}; 0052 #endif 0053 }} // end namespace boost::hana 0054 0055 #endif // !BOOST_HANA_FWD_FOR_EACH_HPP
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|