Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / example / interleaved_ptr.hpp
index 7809adc..a60fc9d 100644 (file)
@@ -8,7 +8,11 @@
 #ifndef BOOST_GIL_EXAMPLE_INTERLEAVED_PTR_HPP
 #define BOOST_GIL_EXAMPLE_INTERLEAVED_PTR_HPP
 
-#include <boost/gil/pixel_iterator.hpp>
+#include <boost/gil.hpp>
+#include <boost/mp11.hpp>
+
+#include <type_traits>
+
 #include "interleaved_ref.hpp"
 
 // Example on how to create a pixel iterator
@@ -29,13 +33,16 @@ namespace boost { namespace gil {
 
 template <typename ChannelPtr,  // Models Channel Iterator (examples: unsigned char* or const unsigned char*)
           typename Layout>      // A layout (includes the color space and channel ordering)
-struct interleaved_ptr : public  boost::iterator_facade<interleaved_ptr<ChannelPtr,Layout>,
-                                   pixel<typename std::iterator_traits<ChannelPtr>::value_type,Layout>,
-                                   boost::random_access_traversal_tag,
-                                   const interleaved_ref<typename std::iterator_traits<ChannelPtr>::reference,Layout>>
+struct interleaved_ptr : boost::iterator_facade
+    <
+        interleaved_ptr<ChannelPtr, Layout>,
+        pixel<typename std::iterator_traits<ChannelPtr>::value_type, Layout>,
+        boost::random_access_traversal_tag,
+        interleaved_ref<typename std::iterator_traits<ChannelPtr>::reference, Layout> const
+    >
 {
 private:
-    using parent_t boost::iterator_facade
+    using parent_t boost::iterator_facade
         <
             interleaved_ptr<ChannelPtr, Layout>,
             pixel<typename std::iterator_traits<ChannelPtr>::value_type, Layout>,
@@ -75,7 +82,7 @@ public:
           ChannelPtr& channels()                  { return _channels; }
 
     // Not required by concepts but useful
-    static const std::size_t num_channels = mpl::size<typename Layout::color_space_t>::value;
+    static const std::size_t num_channels = mp11::mp_size<typename Layout::color_space_t>::value;
 private:
     ChannelPtr _channels;
     friend class boost::iterator_core_access;
@@ -110,12 +117,12 @@ public:
 };
 
 template <typename ChannelPtr, typename Layout>
-struct iterator_is_mutable<interleaved_ptr<ChannelPtr,Layout>> : public boost::mpl::true_ {};
+struct iterator_is_mutable<interleaved_ptr<ChannelPtr,Layout>> : std::true_type {};
 template <typename Channel, typename Layout>
-struct iterator_is_mutable<interleaved_ptr<const Channel*,Layout>> : public boost::mpl::false_ {};
+struct iterator_is_mutable<interleaved_ptr<const Channel*,Layout>> : std::false_type {};
 
 template <typename ChannelPtr, typename Layout>
-struct is_iterator_adaptor<interleaved_ptr<ChannelPtr,Layout>> : public boost::mpl::false_ {};
+struct is_iterator_adaptor<interleaved_ptr<ChannelPtr,Layout>> : std::false_type {};
 
 /////////////////////////////
 //  PixelBasedConcept
@@ -134,7 +141,7 @@ struct channel_mapping_type<interleaved_ptr<ChannelPtr,Layout>>
 };
 
 template <typename ChannelPtr, typename Layout>
-struct is_planar<interleaved_ptr<ChannelPtr,Layout>> : public mpl::false_ {};
+struct is_planar<interleaved_ptr<ChannelPtr,Layout>> : std::false_type {};
 
 /////////////////////////////
 //  HomogeneousPixelBasedConcept