user855
user855

Reputation: 19918

Conflict between boost:type_erasure and boost::iterator_facade

Consider this very simple program:

#include <boost/type_erasure/is_placeholder.hpp>
#include <boost/iterator/iterator_adaptor.hpp>

int main()
{
    return 0;
}

This fails to compile with:

  include/boost/type_erasure/is_placeholder.hpp:31:33: error: reference to 'use_default' is ambiguous
    struct is_placeholder< ::boost::use_default> : ::boost::mpl::false_ {};
                                    ^
    include/boost/iterator/iterator_adaptor.hpp:44:18: note: candidate found by name lookup is 'boost::use_default'
    using iterators::use_default;
                     ^
    include/boost/type_erasure/is_placeholder.hpp:21:8: note: candidate found by name lookup is 'boost::use_default'
    struct use_default;
           ^
    1 error generated.

I don't want to go and change those header files. How do I get around this issue?

Upvotes: 3

Views: 209

Answers (1)

cqdjyy01234
cqdjyy01234

Reputation: 1190

A temporary solution would be replace

struct use_default;

in `boost/type_erasure/is_placeholder.hpp' with

namespace iterators {
    struct use_default;
}
using iterators::use_default;

Which is found in `boost/iterator/iterator_adaptor.hpp'.

Upvotes: 1

Related Questions