<commit_before>#ifndef BOOST_FUSION_ADAPTED_STRUCT_PRINTER_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_PRINTER_HPP

#include <boost/variant.hpp>
#include <pre/boost/fusion/traits/is_boost_variant.hpp>
#include <boost/fusion/include/tag_of.hpp>

#include <boost/fusion/include/is_sequence.hpp>
#include <pre/boost/fusion/for_each_member.hpp>

#include <boost/fusion/include/io.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <pre/iostreams/indenting_ostream.hpp>
#include <pre/boost/fusion/detail/cstdint_to_hexa_stream_operators.hpp>
#include <pre/boost/fusion/detail/std_containers_ostream_operators.hpp>


namespace boost { namespace fusion {


  namespace detail {
    using pre::iostreams::indent;
    using pre::iostreams::deindent;

    template<class T>
    using enable_if_is_not_sequence_nor_variant_t = typename std::enable_if<
      ! ( (boost::fusion::traits::is_sequence<T>::value )

          || traits::is_boost_variant<T>::value)
    ,T>::type;

    template<class T>
    using enable_if_is_other_sequence_and_not_variant_t = typename std::enable_if<
      boost::fusion::traits::is_sequence<T>::value
      && !std::is_same< 
            typename boost::fusion::traits::tag_of<T>::type, 
            boost::fusion::struct_tag
          >::value
      && !traits::is_boost_variant<T>::value 
    ,T>::type;

    template<class T>
    using enable_if_is_adapted_struct_t = typename std::enable_if< 
      std::is_same<
        typename boost::fusion::traits::tag_of<T>::type, 
        boost::fusion::struct_tag
      >::value
    ,T>::type;


    template<class T>
    using enable_if_is_variant_t = typename std::enable_if<
      traits::is_boost_variant<T>::value
    ,T>::type;


    struct adapted_struct_printer : public boost::static_visitor<> {

      adapted_struct_printer(std::ostream& os) 
        : boost::static_visitor<>(),  m_os(os) {}

      template<class T, 
        enable_if_is_adapted_struct_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " :";
        m_os << indent;
        this->operator()(value);
        m_os << deindent;
      }

      template<class T, 
        enable_if_is_adapted_struct_t<T>* = nullptr>
      void operator()(const T& value) const {
        m_os << "\n{" << indent << "\n";
        boost::fusion::for_each_member(value, *this);
        m_os << deindent << "}\n";
      }

      template<class T, 
        enable_if_is_other_sequence_and_not_variant_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " :";
        m_os << indent;
        this->operator()(value);
        m_os << deindent;
      }

      template<class T, 
        enable_if_is_other_sequence_and_not_variant_t<T>* = nullptr>
      void operator()(const T& value) const {
        m_os << "\n{" << indent << "\n";
        boost::fusion::operator<<(m_os, value);
        m_os << "\n" << deindent << "}\n";
      }

      template<class T, 
        enable_if_is_variant_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " : \n";
        m_os << indent;
        this->operator()(value);
        m_os << deindent;
      }

      template<class T, 
        enable_if_is_variant_t<T>* = nullptr>
      void operator()(const T& value) const {
        m_os << "\n{" << indent << "\n";
        boost::apply_visitor(*this, value);
        m_os << deindent << "}\n";
      }

      template<class T, 
        enable_if_is_not_sequence_nor_variant_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " : ";
        this->operator()(value);
        m_os << ",\n";
      }

      template<class T, 
        enable_if_is_not_sequence_nor_variant_t<T>* = nullptr>
      void operator()(const T& value) const {
        using boost::fusion::operator<<;
        m_os << value;
      }
      
      private:
        std::ostream& m_os;
      
    };

  }

  namespace adapted_struct_printer {
    template<class T, 
      detail::enable_if_is_adapted_struct_t<T>* = nullptr>
    inline std::ostream& operator<<(std::ostream& os, const T& value) {
        pre::iostreams::indenting_stream indentos(os);
        detail::adapted_struct_printer printer(indentos);
        printer(value);
        return os;
    }
  }

}}

#endif<commit_msg>BUGFIX: Avoid that volatile keyword get propagated to the printer, which might generate build error.<commit_after>#ifndef BOOST_FUSION_ADAPTED_STRUCT_PRINTER_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_PRINTER_HPP

#include <boost/variant.hpp>
#include <pre/boost/fusion/traits/is_boost_variant.hpp>
#include <boost/fusion/include/tag_of.hpp>

#include <boost/fusion/include/is_sequence.hpp>
#include <pre/boost/fusion/for_each_member.hpp>

#include <boost/fusion/include/io.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <pre/iostreams/indenting_ostream.hpp>
#include <pre/boost/fusion/detail/cstdint_to_hexa_stream_operators.hpp>
#include <pre/boost/fusion/detail/std_containers_ostream_operators.hpp>


namespace boost { namespace fusion {


  namespace detail {
    using pre::iostreams::indent;
    using pre::iostreams::deindent;

    template<class T>
    using enable_if_is_not_sequence_nor_variant_t = typename std::enable_if<
      ! ( (boost::fusion::traits::is_sequence<T>::value )

          || traits::is_boost_variant<T>::value)
    ,T>::type;

    template<class T>
    using enable_if_is_other_sequence_and_not_variant_t = typename std::enable_if<
      boost::fusion::traits::is_sequence<T>::value
      && !std::is_same< 
            typename boost::fusion::traits::tag_of<T>::type, 
            boost::fusion::struct_tag
          >::value
      && !traits::is_boost_variant<T>::value 
    ,T>::type;

    template<class T>
    using enable_if_is_adapted_struct_t = typename std::enable_if< 
      std::is_same<
        typename boost::fusion::traits::tag_of<T>::type, 
        boost::fusion::struct_tag
      >::value
    ,T>::type;


    template<class T>
    using enable_if_is_variant_t = typename std::enable_if<
      traits::is_boost_variant<T>::value
    ,T>::type;


    struct adapted_struct_printer : public boost::static_visitor<> {

      adapted_struct_printer(std::ostream& os) 
        : boost::static_visitor<>(),  m_os(os) {}

      template<class T, 
        enable_if_is_adapted_struct_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " :";
        m_os << indent;
        this->operator()(value);
        m_os << deindent;
      }

      template<class T, 
        enable_if_is_adapted_struct_t<T>* = nullptr>
      void operator()(const T& value) const {
        m_os << "\n{" << indent << "\n";
        boost::fusion::for_each_member(value, *this);
        m_os << deindent << "}\n";
      }

      template<class T, 
        enable_if_is_other_sequence_and_not_variant_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " :";
        m_os << indent;
        this->operator()(value);
        m_os << deindent;
      }

      template<class T, 
        enable_if_is_other_sequence_and_not_variant_t<T>* = nullptr>
      void operator()(const T& value) const {
        m_os << "\n{" << indent << "\n";
        boost::fusion::operator<<(m_os, value);
        m_os << "\n" << deindent << "}\n";
      }

      template<class T, 
        enable_if_is_variant_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " : \n";
        m_os << indent;
        this->operator()(value);
        m_os << deindent;
      }

      template<class T, 
        enable_if_is_variant_t<T>* = nullptr>
      void operator()(const T& value) const {
        m_os << "\n{" << indent << "\n";
        boost::apply_visitor(*this, value);
        m_os << deindent << "}\n";
      }

      template<class T, 
        enable_if_is_not_sequence_nor_variant_t<T>* = nullptr>
      void operator()(const char* name, const T& value) const {
        m_os << name << " : ";
        this->operator()(value);
        m_os << ",\n";
      }

      template<class T, 
        enable_if_is_not_sequence_nor_variant_t<T>* = nullptr>
      void operator()(const T& value) const {
        using boost::fusion::operator<<;
        m_os << value;
      }
      
      private:
        std::ostream& m_os;
      
    };

  }

  namespace adapted_struct_printer {
    template<class T, 
      detail::enable_if_is_adapted_struct_t<typename std::remove_volatile<T>::type >* = nullptr>
    inline std::ostream& operator<<(std::ostream& os, const T& value) {
        pre::iostreams::indenting_stream indentos(os);
        detail::adapted_struct_printer printer(indentos);
        printer(value);
        return os;
    }
  }

}}

#endif
{'fraction_non_alphanumeric': 0.13983098591549295, 'fraction_numerical': 0.0, 'mean_word_length': 2.920494699646643, 'pattern_counts': {'":': 0, '<': 238, '<?xml version=': 0, '>': 106, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5926188', 'n_tokens_mistral': 3073, 'n_tokens_neox': 2925, 'n_words': 518}