Skip to content

Instantly share code, notes, and snippets.

@afabri
Created November 20, 2018 11:33
Show Gist options
  • Save afabri/8a28b1c30cedbc6e9dfc492a419e399a to your computer and use it in GitHub Desktop.
Save afabri/8a28b1c30cedbc6e9dfc492a419e399a to your computer and use it in GitHub Desktop.
#include <utility>
struct Vertex{};
typedef std::pair<int,int> Facet;
struct Simplex {
operator Vertex() { return Vertex();}
operator Facet() { return std::make_pair(1,1);}
};
int main()
{
Vertex v;
Facet f;
Simplex s;
v = s;
f = s; // pair& operator=(const volatile pair&) = delete;
return 0;
}
/*
[ 50%] Building CXX object CMakeFiles/simplex.dir/simplex.cpp.obj
simplex.cpp
C:\cgal\git\Skin_surface_3\examples\Skin_surface_3\simplex.cpp(20): error C2679: binary '=': no operator found which takes a right-hand operand of type 'Simplex' (or there is no acceptable conversion)
c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\utility(276): note: could be 'std::pair<int,int> &std::pair<int,int>::operator =(volatile const std::pair<int,int> &)'
C:\cgal\git\Skin_surface_3\examples\Skin_surface_3\simplex.cpp(20): note: while trying to match the argument list '(Facet, Simplex)'
*/
@afabri
Copy link
Author

afabri commented Nov 20, 2018

The line f = s; does not compile with VC2017 and the preview release. It is the condensed version of the Skin_surface_3 testsuite.

@afabri
Copy link
Author

afabri commented Nov 21, 2018

MS plans to fix it for VC2019. See here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment