Opened 12 years ago

Closed 12 years ago

#4584 closed Bugs (fixed)

recursive_variant_ fails with VC++ 2010's map

Reported by: Cory Nelson <phrosty@…> Owned by: ebf
Milestone: To Be Determined Component: variant
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

Code like this:

make_recursive_variant<int, std::map<int, recursive_variant_>>::type

Fails on VC++ because the map is instantiated which in turn instantiates std::pair<int, recursive_variant_>. pair does not work with the incomplete type recursive_variant_.

Simple workaround is to change variant_fwd.hpp:

struct recursive_variant_;

to:

struct recursive_variant_ {};

Change History (3)

comment:1 by Cory Nelson <phrosty@…>, 12 years ago

Alright, this bug can be simplified by using std::pair directly instead of std::map.

comment:2 by ilya@…, 12 years ago

Confirmed bug on VC++ 2008 SP1.

comment:3 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [67604]) Avoid error instantiating map with recursive_variant_. Disable ADL to make instantiation less likely. Fixes #4584.

Note: See TracTickets for help on using tickets.