Opened 8 years ago

Closed 7 years ago

#11203 closed Bugs (fixed)

boost::none compile errors with MSVC

Reported by: raad@… Owned by: akrzemi1
Milestone: Boost 1.60.0 Component: optional
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc: marci_r@…

Description

The new boost::none in 1.58 doesn't compile on MSVC when using precomiled headers.

Code to reproduce the problem:

precompiled header stdafx.h:

#include <boost/optional.hpp>

s.cpp:

#include "stdafx.h"

struct s {
 void f(boost::optional<int> const& = boost::none) {}
};

On MSVC12, this results in the error message:

s.cpp(3): error C3083: ' ?? A0x06d21c56': the symbol to the left of a '::' must be a type

Defining BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE works around the problem, but I haven't found it documented anywhere.

Change History (2)

comment:1 by akrzemi1, 7 years ago

Owner: changed from Fernando Cacciola to akrzemi1

comment:2 by akrzemi1, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.