1/*=============================================================================
2 Copyright (c) 2022 Denis Mikhailov
3 Distributed under the Boost Software License, Version 1.0. (See accompanying
4 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5==============================================================================*/
6
7#if !defined(BOOST_FUSION_TRANSFORM_VIEW_KEY_OF_IMPL_JAN_9_2022_0354PM)
8#define BOOST_FUSION_TRANSFORM_VIEW_KEY_OF_IMPL_JAN_9_2022_0354PM
9
10#include <boost/fusion/support/config.hpp>
11#include <boost/fusion/iterator/deref.hpp>
12#include <boost/type_traits/remove_reference.hpp>
13#include <boost/type_traits/remove_const.hpp>
14#include <boost/utility/result_of.hpp>
15
16namespace boost { namespace fusion
17{
18 struct transform_view_iterator_tag;
19 struct transform_view_iterator2_tag;
20
21 namespace extension
22 {
23 template<typename Tag>
24 struct key_of_impl;
25
26 // Unary Version
27 template<>
28 struct key_of_impl<transform_view_iterator_tag>
29 {
30 template <typename Iterator>
31 struct apply
32 {
33 typedef typename
34 result_of::deref<typename Iterator::first_type>::type
35 value_type;
36
37 typedef typename Iterator::transform_type F;
38 typedef typename boost::result_of<F(value_type)>::type transformed_type;
39 typedef typename boost::remove_reference<transformed_type>::type transformed_type_unref;
40 typedef typename boost::remove_const<transformed_type_unref>::type transformed_type_unconst;
41
42 typedef typename transformed_type_unconst::first_type type;
43 };
44 };
45
46 // Binary Version is not supported with Associative Sequence
47 }
48}}
49#endif
50