Code Monkey home page Code Monkey logo

bimap's People

Contributors

beman avatar brycelelbach avatar dabrahams avatar danielae avatar danieljames avatar eldiener avatar fanquake avatar glenfe avatar grafikrobot avatar imikejackson avatar jewillco avatar joaquintides avatar jzmaddock avatar luzpaz avatar marcelraad avatar morinmorin avatar patak-dev avatar pdimov avatar sloriot avatar soapgentoo avatar steveire avatar straszheim avatar swatanabe avatar tinko92 avatar vadz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bimap's Issues

Visual Studio 2019 crash including boost/bimap.hpp

`
simply #include <boost/bimap.hpp> crashes the Visual Studio 2019 compiler.
crash occurs when stdafx.h includes boost/bimap.hpp

boost_1_75_0

C/C++ project properties:

Disable language extensions: no
Conformance mode: Defailt
Wchar_t as Built-In: yes
Force loop scope: yes
enforce type conversion: not set
RTTI: not set
Open MP: not set
C++ Language Standard ISO C++ 14
C Language Standard: Default (Legacy MSVC)
Enaable experimental: not set

1>stdafx.cpp
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\operators.hpp(161,1): fatal error C1001: Internal compiler error.
1>(compiler file 'msc1.cpp', line 1588)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>If possible please provide a repro here: https://developercommunity.visualstudio.com
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\operators.hpp(141): message : see reference to class template instantiation 'boost::operators_impl::equality_comparable2<T,U,B>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> U=unsigned int,
1> B=boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type
1> ]
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\operators.hpp(421): message : see reference to class template instantiation 'boost::operators_impl::less_than_comparable2<T,U,boost::operators_impl::equality_comparable2<T,U,B>>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> U=unsigned int,
1> B=boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type
1> ]
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\operators.hpp(168): message : see reference to class template instantiation 'boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_base>' being compiled
1> with
1> [
1> T=boost::serialization::version_type
1> ]
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\operators.hpp(152): message : see reference to class template instantiation 'boost::operators_impl::equality_comparable1<T,B>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> B=boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type>
1> ]
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\operators.hpp(427): message : see reference to class template instantiation 'boost::operators_impl::less_than_comparable1<T,boost::operators_impl::equality_comparable1<T,B>>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> B=boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type>
1> ]
1>H:\Svn\ThirdParty-2019\boost_1_75_0\boost\serialization\serialization.hpp(52): message : see reference to class template instantiation 'boost::operators_impl::totally_ordered1<boost::serialization::version_type,boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_base>>' being compiled
1> with
1> [
1> T=boost::serialization::version_type
1> ]
1>INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\CL.exe'
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
`

bimap construction process seems to discard return value of function (std::less) with 'nodiscard' attribute

By using boost 1.72.0.0 c++ library and the recent release of Visual Studio 2019 (version 16.9), we found that a warning "warning C4834: discarding return value of function with 'nodiscard' attribute" appears in the bimap construction, as illustrated in the following.
image

After doing some exploarions, we found that VS 2019 16.9 set all the operators, including std::less, with [[nodiscard]] attribute in the commit https://github.com/microsoft/STL/commit/b4af6e98f88df3a283dc2b2f1af9616684173ab4#diff-e3f9e6952fd73d97f01dd5f71b44bf0f195dc24eae335e5c0138ff25c6b559dd. As the bimap construction process uses std::less operator and seems to discard the returned bool value (see BOOST_concept(BinaryFunction,(Func)(Return)(First)(Second)) in concept_check.hpp), such warning thus appears.

Will bimap community paln to solve this issue?

operators.hpp(154,1): fatal error C1001: Internal compiler error

Hi

I am migrating to VS2019, boost Release 1.70.0
C++ Language Standard ISO C++ 14
C Language Standard: Default (Legacy MSVC)


** Visual Studio 2019 Developer Command Prompt v16.9.4
** Copyright (c) 2021 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: 'x64_x86'

C:\Windows\System32>cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x86

### The Error
1>C:\Dev\Prj\3rdParty\boost\boost\operators.hpp(154,1): fatal error C1001: Internal compiler error.
1>(compiler file 'msc1.cpp', line 1588)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>If possible please provide a repro here: https://developercommunity.visualstudio.com
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1>C:\Dev\Prj\3rdParty\boost\boost\operators.hpp(134): message : see reference to class template instantiation 'boost::operators_impl::equality_comparable2<T,U,B>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> U=unsigned int,
1> B=boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type
1> ]
1>C:\Dev\Prj\3rdParty\boost\boost\operators.hpp(414): message : see reference to class template instantiation 'boost::operators_impl::less_than_comparable2<T,U,boost::operators_impl::equality_comparable2<T,U,B>>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> U=unsigned int,
1> B=boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type
1> ]
1>C:\Dev\Prj\3rdParty\boost\boost\operators.hpp(161): message : see reference to class template instantiation 'boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_base>' being compiled
1> with
1> [
1> T=boost::serialization::version_type
1> ]
1>C:\Dev\Prj\3rdParty\boost\boost\operators.hpp(145): message : see reference to class template instantiation 'boost::operators_impl::equality_comparable1<T,B>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> B=boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type>
1> ]
1>C:\Dev\Prj\3rdParty\boost\boost\operators.hpp(420): message : see reference to class template instantiation 'boost::operators_impl::less_than_comparable1<T,boost::operators_impl::equality_comparable1<T,B>>' being compiled
1> with
1> [
1> T=boost::serialization::version_type,
1> B=boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_baseboost::serialization::version_type>
1> ]
1>C:\Dev\Prj\3rdParty\boost\boost\serialization\serialization.hpp(61): message : see reference to class template instantiation 'boost::operators_impl::totally_ordered1<boost::serialization::version_type,boost::operators_impl::totally_ordered2<boost::serialization::version_type,unsigned int,boost::operators_impl::operators_detail::empty_base>>' being compiled
1> with
1> [
1> T=boost::serialization::version_type
1> ]
1>INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\CL.exe'
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information

The error is in this part ;

template <class T, class U, class B = operators_detail::empty_base<T> >
struct equality_comparable2 : B
{
     friend bool operator==(const U& y, const T& x) { return x == y; }
     friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); }
     friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); }
};

Any help please ?????

transparent operator like `less<void>` is not functionally usable with bimap

The current implementation is not allow to use transparent comparator/hash operator functionality.

boost::bimap<int, boost::bimaps::set_of<const char*, std::less<>>> test;

std::string stg;
test.right.find(stg); // error

The compile error message is the following:

/opt/compiler-explorer/libs/boost_1_80_0/boost/bimap/container_adaptor/associative_container_adaptor.hpp:194:17: error: no matching function for call to object of type 'boost::bimaps::container_adaptor::detail::key_to_base_identity<const char *, const char *const>'
                this->template functor<key_to_base>()(k)

End of line comments in BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP macro call in set_of.hpp

There is a macro call

BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP(

    // binds to
    multi_index::ordered_unique,

    // with
    key_compare
)

in the file boost/bimap/set_of.hpp. There is nothing wrong with that. However, if you run this in preprocess only mode for Visual Studio (which we need as input for our code checkers), it will end up in incorrect code:

// binds to// withtemplate< class KeyExtractor, class Tag > struct index_bind { typedef multi_index::ordered_unique < multi_index::tag< Tag >, KeyExtractor, key_compare > type; };

I know that this is a bug in Visual Studio, but it help if you can change it into

BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP(

    /* binds to */
    multi_index::ordered_unique,

    /* with */
    key_compare
)

i.e. changing // comments into /* .. */ comments twice. Many thanks for your help.

For my own reference this is TiCS ticket 21934.

Modular Boost C++ Libraries Request

We are in the process of making B2 build changes to all of the B2 build files
to support "modular" consumption of the Boost Libraries by users. See this list
post for some details: https://lists.boost.org/Archives/boost/2024/01/255704.php

The process requires making a variety of changes to make each Boost library
independent of the super-project structure. But the changes do not remove the
super-project structure or the comprehensive Boost release. The changes make
solely make it possible, optionally, for users, like package manages, to easily
consume libraries individually.

Generally the changes include:

  • Adding a libroot/build.jam.
  • Porting any functionality from libroot/jamfile to libroot/build.jam.
  • Moving boost-install declaration from libroot/build/jamfile is applicable.
  • Adjusting other B2 build files in the library, like test/jamfile, as needed.
  • Possible changes to C++ source files to remove includes relative to the
    super-project boostroot location.

Some examples of such changes:

We are asking how you would like us to handle the changes. We would prefer if
you allow the owners of the Boost.org GitHub project to make changes to B2
build files, as needed, to accomplish the changes. But understand
that you may want to manage the proposed changes yourself.

We previously sent emails to all known maintainers to fill out a form with their
preference. We are contacting you in this issue as we have not gotten a response
to that email. You can see the ongoing responses for that form and the responses
to these issues here https://github.com/users/grafikrobot/projects/1/views/6

We are now asking if you can reply directly to this issue to indicate your
preference of handling the changes. Please supply a response to this question
and close the issue (so that we can verify you are a maintainer).

How would you like the build changes to be processed?

  1. Pull request, reviewed and merged by a BOOSTORG OWNER.
  2. Pull request, reviewed and merged by YOU.
  3. Other. (please specify details in the reply)

Also please indicate any special instructions you want us to consider. Or other
information you want us to be aware of.

Thanks you, René

"countries names" ==> "countries' names" (or something)

The documentation's use of countries -- i.e. without an apostrophe -- to mean the possessive, makes for awkward reading. Examples to be found include:

  • countries names
  • countries populations

If the plural form of country is imperative -- i.e countries -- then the plural possessive form takes a trailing apostrophe: countries'.

But even when given the trailing apostrophe, countries' remains awkward to read.

I do not think there would be any loss of understanding if:

  • country names
  • country populations

were used, instead. If we were discussing Ford, Chrysler, GM, and Fiat, we might write "car brands", but we would (hopefully) not write "cars' brands".

I see that the docs have been in their current state for a while. Too late to change?

allow MSVC mimicry by clang-based compilers

MSVC-like compilers fail to process the older definitions BOOST_BIMAP_MAP_VIEW_BASE_FRIEND and BOOST_BIMAP_SET_VIEW_BASE_FRIEND but are forced into them by checks of the BOOST_MSVC auto-detected define.

Depending on the compiler, Boost defines the above macros to expand into an appropriate form of a friend class declaration. It has to sense the compiler because MSVC did not accept an instance of a template class as a friend "right away".

friend class tplclass<T>;

MSVC needed an additional typedef to make that work.

typedef tplclass<T> tplinstclass;
friend class tplinstclass;

One clang-based static analyzer mimics MSVC in many aspects but does not agree with the Boost work-around. It rejects the above Boost's work-around for MSVC because usage of a typedef-ed class name is not taking the class specifier.

include\boost/bimap/views/map_view.hpp:57:5: error: typedef 'friend_map_view_base' cannot be referenced with a class specifier
include\boost/bimap/views/set_view.hpp:56:5: error: typedef 'template_class_friend' cannot be referenced with a class specifier

I therefore suggest limiting the older friend class declaration to the older MSVC versions,

-#if defined(BOOST_MSVC)
+#if defined(BOOST_MSVC) && (_MSC_VER < 1910)

Alternatively, the typedef-ed name of kind tplinstclass can be used without the class specifier, that is, as friend tplinstclass in the existing BOOST_MSVC branch of the macro definitions. But this may break builds of Boost consumers with older MSVC compilers because those builds are unlikely to be tested with the change.

Tests failing on Windows with MSVC and GCC

On my Windows 10, with MS Visual Studio 2017 and MinGW with GCC 7.2 I have installed Boost following steps on https://github.com/boostorg/boost/wiki/Getting-Started:

git clone --recursive https://github.com/boostorg/boost.git
cd boost
git checkout develop
.\bootstrap
.\b2 headers

Then I have added b2 to my PATH and done this:

cd libs\bimap\test
b2 # for MSVC
b2 toolset=gcc # for GCC

Sadly in both cases some tests failed. Different tests with both cases. Below console outputs are from a second run of b2 to take out staff that is OK:

C:\Boost\boost\libs\bimap\test>b2
..\..\..\libs\log\build\Jamfile.v2:45: Unescaped special character in argument <define>$(flag)=1
C:/Boost/boost/libs/predef/check/../tools/check\predef.jam:46: Unescaped special character in argument $(language)::$(expression)
Performing configuration checks

    - default address-model    : 32-bit (cached)
    - default architecture     : x86 (cached)
    - symlinks supported       : yes (cached)
...patience...
...patience...
...patience...
...found 5709 targets...
...updating 3 targets...
msvc.write-setup-script ..\..\..\bin.v2\standalone\msvc\msvc-14.1\msvc-setup.bat
testing.capture-output ..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.run
====== BEGIN OUTPUT ======
C:\Boost\boost\libs/bimap/test/test_bimap.hpp(417): test const_c.bucket_size(const_c.bucket(di->first)) == 1 failed in function: 'void __cdecl test_pair_unordered_associative_container<class boost::bimaps::views::unordered_multimap_view<struct boost::bimaps::relation::member_at::right,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<char,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> >,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > >>(class boost::bimaps::views::unordered_multimap_view<struct boost::bimaps::relation::member_at::right,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<char,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> > &,const class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > > &)'
C:\Boost\boost\libs/bimap/test/test_bimap.hpp(417): test const_c.bucket_size(const_c.bucket(di->first)) == 1 failed in function: 'void __cdecl test_pair_unordered_associative_container<class boost::bimaps::views::unordered_multimap_view<struct boost::bimaps::relation::member_at::right,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<char,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> >,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > >>(class boost::bimaps::views::unordered_multimap_view<struct boost::bimaps::relation::member_at::right,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<char,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> > &,const class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > > &)'
C:\Boost\boost\libs/bimap/test/test_bimap.hpp(417): test const_c.bucket_size(const_c.bucket(di->first)) == 1 failed in function: 'void __cdecl test_pair_unordered_associative_container<class boost::bimaps::views::unordered_multimap_view<struct boost::bimaps::relation::member_at::right,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<char,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> >,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > >>(class boost::bimaps::views::unordered_multimap_view<struct boost::bimaps::relation::member_at::right,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<char,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> > &,const class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > > &)'
C:\Boost\boost\libs/bimap/test/test_bimap.hpp(417): test const_c.bucket_size(const_c.bucket(di->first)) == 1 failed in function: 'void __cdecl test_pair_unordered_associative_container<class boost::bimaps::views::unordered_multimap_view<struct right_tag,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<struct boost::bimaps::tags::tagged<char,struct left_tag>,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<struct boost::bimaps::tags::tagged<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct right_tag>,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> >,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > >>(class boost::bimaps::views::unordered_multimap_view<struct right_tag,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<struct boost::bimaps::tags::tagged<char,struct left_tag>,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<struct boost::bimaps::tags::tagged<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct right_tag>,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> > &,const class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > > &)'
C:\Boost\boost\libs/bimap/test/test_bimap.hpp(417): test const_c.bucket_size(const_c.bucket(di->first)) == 1 failed in function: 'void __cdecl test_pair_unordered_associative_container<class boost::bimaps::views::unordered_multimap_view<struct right_tag,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<struct boost::bimaps::tags::tagged<char,struct left_tag>,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<struct boost::bimaps::tags::tagged<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct right_tag>,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> >,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > >>(class boost::bimaps::views::unordered_multimap_view<struct right_tag,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<struct boost::bimaps::tags::tagged<char,struct left_tag>,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<struct boost::bimaps::tags::tagged<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct right_tag>,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> > &,const class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > > &)'
C:\Boost\boost\libs/bimap/test/test_bimap.hpp(417): test const_c.bucket_size(const_c.bucket(di->first)) == 1 failed in function: 'void __cdecl test_pair_unordered_associative_container<class boost::bimaps::views::unordered_multimap_view<struct right_tag,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<struct boost::bimaps::tags::tagged<char,struct left_tag>,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<struct boost::bimaps::tags::tagged<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct right_tag>,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> >,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > >>(class boost::bimaps::views::unordered_multimap_view<struct right_tag,class boost::bimaps::detail::bimap_core<struct boost::bimaps::unordered_set_of<struct boost::bimaps::tags::tagged<char,struct left_tag>,struct boost::hash<char>,struct std::equal_to<char> >,struct boost::bimaps::unordered_multiset_of<struct boost::bimaps::tags::tagged<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct right_tag>,struct boost::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::mpl::na,struct boost::mpl::na,struct boost::mpl::na> > &,const class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,char> > > &)'

**** 6 errors detected

EXIT STATUS: 201
====== END OUTPUT ======


    set status=0
    if %status% NEQ 0 (
        echo Skipping test execution due to testing.execute=off
        exit 0
    )
     "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.exe"   > "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.output" 2>&1
    set status=%ERRORLEVEL%
    echo. >> "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.output"
    echo EXIT STATUS: %status% >> "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.output"
    if %status% EQU 0 (
        copy "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.output" "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.run"
    )
    set verbose=0
    if %status% NEQ 0 (
        set verbose=1
    )
    if %verbose% EQU 1 (
        echo ====== BEGIN OUTPUT ======
        type "..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.output"
        echo ====== END OUTPUT ======
    )
    exit %status%

...failed testing.capture-output ..\..\..\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.1\debug\threading-multi\test_bimap_unordered.run...
...failed updating 1 target...
...skipped 1 target...
...updated 2 targets...

The same with GCC:

C:\Boost\boost\libs\bimap\test>b2 toolset=gcc
..\..\..\libs\log\build\Jamfile.v2:45: Unescaped special character in argument <define>$(flag)=1
C:/Boost/boost/libs/predef/check/../tools/check\predef.jam:46: Unescaped special character in argument $(language)::$(expression)
Performing configuration checks

    - default address-model    : 64-bit (cached)
    - default architecture     : x86 (cached)
    - symlinks supported       : yes (cached)
...patience...
...patience...
...patience...
...found 5660 targets...
...updating 2 targets...
testing.capture-output ..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.run
====== BEGIN OUTPUT ======
..\..\../boost/test/minimal.hpp(136): exception "boost::archive::archive_exception: output stream error" caught in function: 'int main(int, char**)'

**** Testing aborted.
**** 1 error detected

EXIT STATUS: 201
====== END OUTPUT ======

    set Path=C:\Boost\boost\bin.v2\libs\serialization\build\gcc-7.2.0\debug;C:\MinGW\bin;C:\MinGW\lib;C:\MinGW\lib32;C:\MinGW\lib64;%Path%

    set status=0
    if %status% NEQ 0 (
        echo Skipping test execution due to testing.execute=off
        exit 0
    )
     "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.exe"   > "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.output" 2>&1
    set status=%ERRORLEVEL%
    echo. >> "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.output"
    echo EXIT STATUS: %status% >> "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.output"
    if %status% EQU 0 (
        copy "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.output" "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.run"
    )
    set verbose=0
    if %status% NEQ 0 (
        set verbose=1
    )
    if %verbose% EQU 1 (
        echo ====== BEGIN OUTPUT ======
        type "..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.output"
        echo ====== END OUTPUT ======
    )
    exit %status%

...failed testing.capture-output ..\..\..\bin.v2\libs\bimap\test\test_bimap_serialization.test\gcc-7.2.0\debug\test_bimap_serialization.run...
...failed updating 1 target...
...skipped 1 target...

Am I doing something wrong? How should I proceed to have the tests running clean (as I expected they should)?

One test fails to compile due to errors C3892,C2039 with latset reversion on boost master branch

Environment:
VS2019+Windows Server 2019

Issue description:
Found \boost\libs\bimap build fails to compile due to errors C3892,C2039 in MSVC, this issue can be reproduced on boostorg/boost@97f075e. Could you please take a look?

Reproduce steps:
1.git clone -c core.autocrlf=true --recursive ​https://github.com/boostorg/boost.git F:\gitP\boostorg\boost
2.open a VS 2019 x64 command prompt and browse to F:\gitP\boostorg\boost
3..\bootstrap
4..\b2 headers variant=release --build-dir=..\out\amd64rel address-model=64
5..\b2 variant=release --build-dir=..\out\amd64rel address-model=64
6..\b2 -j16 variant=release --build-dir=F:\gitP\boostorg\boost\out\amd64rel libs\bimap\test address-model=64 2>&1

ErrorMessage:
libs\bimap\test\compile_fail\test_bimap_mutable_1.cpp(36): error C3892: 'cbm': you cannot assign to a variable that is const
Line 177: libs\bimap\test\compile_fail\test_bimap_mutable_3.cpp(35): error C3892: 'bm': you cannot assign to a variable that is const
Line 180: libs\bimap\test\compile_fail\test_bimap_mutable_2.cpp(36): error C3892: 'boost::bimaps::container_adaptor::associative_container_adaptor<Base,Iterator,ConstIterator,KeyType,IteratorToBaseConverter,IteratorFromBaseConverter,ValueToBaseConverter,ValueFromBaseConverter,KeyToBaseConverter,boost::mpl::vector1>::find': you cannot assign to a variable that is const
Line 204: libs\bimap\test\compile_fail\test_bimap_info_2.cpp(35): error C2039: 'info': is not a member of 'boost::bimaps::relation::mutant_relation<TA,TB,Info,false>'
Line 230: .\boost/bimap/views/map_view.hpp(108): error C2039: 'info': is not a member of 'boost::bimaps::relation::structured_pair<TA,TB,Info,boost::bimaps::relation::normal_layout>'
Line 266: libs\bimap\test\compile_fail\test_bimap_info_1.cpp(36): error C3892: 'cbm': you cannot assign to a variable that is const
Line 313: ...failed testing.capture-outputF:\gitP\boostorg\boost\out\amd64rel\boost\bin.v2\libs\bimap\test\test_bimap_unordered.test\msvc-14.2\release\threading-multi\test_bimap_unordered.run...

log
test.log.16.txt

Clang-cl flags -Wmicrosoft-unqualified-friend warnings

In Boost 1.70 (and current master, but I don't have the line numbers handy), these lines spawn a warning:

unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier
map_view_iterator.hpp:
87, 138, 174, 215, 252, 293, 329

It seems to me that simply adding a ::boost::iterators:: qualification will fix this issue. See e.g. https://kod.acikkaynak.gov.tr/libreoffice/core/commit/aef6da021da33f099f99ed633814b8771ad4abda which seems to "fix" the warning locally by disabling the warning.

You can try Clang-cl by installing the CLang-cl options in the VS2019 installer, and e.g. running CMake with -T"ClangCL", or specifying the compiler manually using -DCMAKE_CXX_COMPILER=path/to/clang-cl.exe. You can also just use LLVM's version of clang-cl, it seems to be identical. Just make sure you have either VS2017 or VS2019 installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.