Opened 11 years ago

Closed 8 years ago

#6720 closed Bugs (fixed)

intrusive::unordered_set::clear_and_dispose does not compile on VC11 Beta when passed a stateless lambda

Reported by: Alexander Bessonov <alexbav@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: intrusive
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Attached is a small example code, which, being compiled on VC11 Beta produces a compilation error. The same code compiles successfully on VC2010.

The following error is generated:

...\boost\intrusive\slist.hpp(366): error C2247: 'boost::intrusive::hashtable_impl<Config>::node_cast_adaptor<F>::operator ()' not accessible because 'boost::intrusive::detail::node_disposer<F,Container>' uses 'private' to inherit from 'boost::intrusive::detail::ebo_functor_holder<T>'
          with
          [
              Config=boost::intrusive::detail::usetopt<boost::intrusive::detail::base_hook_traits<Item,boost::intrusive::slist_node_traits<void *>,safe_link,boost::intrusive::default_tag,4>,Item::hash,std::equal_to<Item>,unsigned int,boost::intrusive::detail::bucket_traits_impl<boost::intrusive::detail::get_slist_impl<boost::intrusive::slist_node_traits<void *>>::type>,1>,
              F=boost::intrusive::detail::node_disposer<main::<lambda_4ec9a6cb8e4a7175a276948992bf9089>,boost::intrusive::hashtable_impl<boost::intrusive::detail::usetopt<boost::intrusive::detail::base_hook_traits<Item,boost::intrusive::slist_node_traits<void *>,safe_link,boost::intrusive::default_tag,4>,Item::hash,std::equal_to<Item>,unsigned int,boost::intrusive::detail::bucket_traits_impl<boost::intrusive::detail::get_slist_impl<boost::intrusive::slist_node_traits<void *>>::type>,1>>>
          ]
          and
          [
              F=main::<lambda_4ec9a6cb8e4a7175a276948992bf9089>,
              Container=boost::intrusive::hashtable_impl<boost::intrusive::detail::usetopt<boost::intrusive::detail::base_hook_traits<Item,boost::intrusive::slist_node_traits<void *>,safe_link,boost::intrusive::default_tag,4>,Item::hash,std::equal_to<Item>,unsigned int,boost::intrusive::detail::bucket_traits_impl<boost::intrusive::detail::get_slist_impl<boost::intrusive::slist_node_traits<void *>>::type>,1>>
          ]
          and
          [
              T=main::<lambda_4ec9a6cb8e4a7175a276948992bf9089>
          ]

Attachments (1)

main.cpp (715 bytes ) - added by Alexander Bessonov <alexbav@…> 11 years ago.

Download all attachments as: .zip

Change History (3)

by Alexander Bessonov <alexbav@…>, 11 years ago

Attachment: main.cpp added

comment:1 by y.miroshnyk@…, 8 years ago

I have the same issue on VS12 (2013) when trying to make following:

actions_.clear_and_dispose([](Buffer<ActionRecord>* value) { delete value; });

where actions_ is:

boost::intrusive::set<Buffer<ActionRecord>> actions_;

comment:2 by Ion Gaztañaga, 8 years ago

Resolution: fixed
Status: newclosed

I've changed to public inheritance in classes deriving from ebo_function_holder as a workaround to this MSVC limitation:

[develop 12ee566] Workaround for bugs #10771 and #6720.

Note: See TracTickets for help on using tickets.