t::remove_cv&lt;
     typename std::iterator_traits&lt;I1&gt;
      ::value_type&gt;::type v1_t;

   typedef typename 
    boost::remove_cv&lt;
     typename std::iterator_traits&lt;I2&gt;
      ::value_type&gt;::type v2_t;

   enum{ can_opt = 
      boost::is_same&lt;v1_t, v2_t&gt;::value
      &amp;&amp; boost::is_pointer&lt;I1&gt;::value
      &amp;&amp; boost::is_pointer&lt;I2&gt;::value
      &amp;&amp; boost::
      has_trivial_assign&lt;v1_t&gt;::value 
   };

   return detail::copier&lt;can_opt&gt;: