Boost logo

Boost :

Subject: [boost] [Iterator][Type_Erasure] Conflicting declaration. (Fix is provided.)
From: Deniz Bahadir (deniz.bahadir_at_[hidden])
Date: 2015-07-16 13:19:57

Hi there,

I noticed a "conflicting declaration" error when developing a program
which uses Boost.Program_Options and Boost.Type_Erasure.
Further investigation showed me, that the conflict is actually between
Boost.Iterator and Boost.Type_Erasure.

A test-case which demonstrates this compiler-error is the following
simple two-liner:

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

Clang is quite verbose and outputs the following:

     /tmp/boost-1_58/boost/iterator/iterator_adaptor.hpp:44:18: error:
target of using declaration conflicts with declaration already in scope
     using iterators::use_default;
     /tmp/boost-1_58/boost/iterator/iterator_adaptor.hpp:40:10: note:
target of using declaration
       struct use_default;
     /tmp/boost-1_58/boost/type_erasure/iterator.hpp:27:8: note:
conflicting declaration
     struct use_default;
     1 error generated.

The fix is actually quite simple and should be applied to
Boost.Iterator. I already provided a pull-request [1] for this.

I hope this fix can still make it into the upcoming 1.59 release of Boost.

Best regards,
Deniz Bahadir


Dipl.-Inform. Deniz Bahadir
Winterfeldtstr. 21
10781 Berlin
Phone: +49 - 30 / 577 0004-22
Email: deniz.bahadir_at_[hidden]
Board of Management:
   Michael Wolz, Dr.-Ing. Oliver Holschke, Dr.-Ing. Ingmar Poese
Commercial Register: Amtsgericht Bonn HRB 19378

Boost list run by bdawes at, gregod at, cpdaniel at, john at