Opened 11 years ago

Last modified 11 years ago

#6155 new Bugs

VS2010 compile error in lambda, if posix_time.hpp is included.

Reported by: fzuuzf@… Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost 1.48.0 Severity: Regression
Keywords: vs2010 C2663 Cc:

Description

boost 1.46.1 compiles ok.
boost 1.48 gives:
"error C2663: 'std::vector<_Ty>::at' : 2 overloads have no legal conversion for 'this' pointer"

See annotations in attached testcase.

Compiler error?

Attachments (1)

boost_148_test.zip (6.4 KB ) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (3)

by anonymous, 11 years ago

Attachment: boost_148_test.zip added

comment:1 by anonymous, 11 years ago

#include "stdafx.h"
#include <boost/date_time/posix_time/posix_time.hpp>

#include <vector>
#include <memory>

class A {};

class B: public std::vector<std::shared_ptr<A>> {
public:

	void f() {
		unsigned u_(0);

		auto lambda_([&]() {
			at(u_);		// boost1.48: error C2663: 'std::vector<_Ty>::at' : 2 overloads have no legal conversion for 'this' pointer
					// boost1.46.1: ok
			this->at(u_);	// ok
		});

	}
};



comment:2 by anonymous, 11 years ago

Simplified testcase,
regression also shows without shared_ptr<>:

#include <boost/date_time/posix_time/posix_time.hpp>

class A {};

class B: public std::vector<A> {
public:
	void f() {
		unsigned u_(0);

		auto lambda_([&]() {
			at(u_);		// boost1.48: error C2663: 'std::vector<_Ty>::at' : 2 overloads have no legal conversion for 'this' pointer
					// boost1.46.1: ok
			this->at(u_);	// ok
		});

	}
};

Note: See TracTickets for help on using tickets.