Acceleration of an object.

I am trying to use boost::iterator_facade with an incomplete Value template argument. This fails because iterator_facade tries to check the is_pod type.

Is this the expected behavior? Can I get around this restriction in some way? I could write a class template that simply proxies foo and provides an implicit conversion, but I would rather have a simpler Solution.

 #include <boost/iterator/iterator_facade.hpp> class iter : public boost::iterator_facade< iter, iter, boost::forward_traversal_tag > { private: friend class boost::iterator_core_access; void increment() { } bool equal(iter const& other) const { return true; } iter& dereference() const { return const_cast<iter&>(static_cast<const iter&>(*this)); } }; int main() { iter f; return 0; } 
+4
source share
1 answer

If is_pod is a problem, can't you just specialize it with a type?

On ideone - http://ideone.com/1DR8v - it looks like it works this way even if the type is not defined at all, and is_pod specializes in this incomplete type.

+2
source

Source: https://habr.com/ru/post/1398999/


All Articles