Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code cannot compile in Visual Studio 2015 #2

Open
quant911 opened this issue Mar 30, 2016 · 0 comments
Open

code cannot compile in Visual Studio 2015 #2

quant911 opened this issue Mar 30, 2016 · 0 comments

Comments

@quant911
Copy link

Error msg:
1> Boost.Cpp11.2013.x64.vcxproj -> C:\dev\tapescript_vs2015\bin\vc120-x64-debug\libboost_unit_test_framework-vc120-mt-gd-1_57.lib
2>------ Rebuild All started: Project: Cl.Tape.Cpp11.2013.x64, Configuration: Debug x64 ------
3>------ Rebuild All started: Project: Cl.Tape.Examples.Cpp11.2013.x64, Configuration: Debug x64 ------
3> tape_other_translation_line.cpp
3> tape_example.cpp
3>c:\dev\tapescript_vs2015\tapescript\cpp\cl\tape\examples\impl\quadratic_regression_examples.hpp(209): error C2280: 'cl::tape_innercl::tape_array &cl::tape_innercl::tape_array::operator =(const cl::tape_innercl::tape_array &)': attempting to reference a deleted function
3> c:\dev\tapescript_vs2015\tapescript\cpp\cl\tape\impl\inner\tape_inner.hpp(289): note: compiler has generated 'cl::tape_innercl::tape_array::operator =' here
3> Generating Code...
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

Reason: tape_inner has declared move constructor but not copy constructor. The source code above requires a copy constructor to compile.

In C++11 standard, a copy constructor should not be automatically generated if a move constructor is available. So above code should not compile. In this sense, VS2015 behaves correctly.

VS2013 is known not implementing such C++11 standard.

See links here:
https://msdn.microsoft.com/en-us/library/hh567368%28v=vs.120%29.aspx#rvref (on Rvalue references 3.0)
https://msdn.microsoft.com/en-ca/library/dn457344%28v=vs.120%29.aspx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant