[Iterator][Type_Erasure] Conflicting declaration. (Fix is provided.)
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
On 16.07.2015 20:19, Deniz Bahadir wrote:
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
#include 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.
As I'he commented in the PR, the patch is needed for Boost.TypeErasure. Apparently, it has not been updated for changes in Boost.Iterators in 1.57.
Am 16.07.2015 um 19:39 schrieb Andrey Semashev:
On 16.07.2015 20:19, Deniz Bahadir wrote:
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
#include 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.
As I'he commented in the PR, the patch is needed for Boost.TypeErasure. Apparently, it has not been updated for changes in Boost.Iterators in 1.57.
I provided another pull-request [1], this time to type_erasure. I still hope this fix will make it into the next boost-release. Best regards, Deniz [1] https://github.com/boostorg/type_erasure/pull/6
participants (3)
-
Andrey Semashev
-
Deniz Bahadir
-
Deniz Bahadir