Guest User

Untitled

a guest
Nov 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <utility>
  2.  
  3. struct Vertex{};
  4.  
  5. typedef std::pair<int,int> Facet;
  6.  
  7. struct Simplex {
  8. operator Vertex() { return Vertex();}
  9. operator Facet() { return std::make_pair(1,1);}
  10. };
  11.  
  12. int main()
  13. {
  14. Vertex v;
  15. Facet f;
  16. Simplex s;
  17.  
  18. v = s;
  19. f = s; // pair& operator=(const volatile pair&) = delete;
  20.  
  21. return 0;
  22. }
  23.  
  24. /*
  25.  
  26. [ 50%] Building CXX object CMakeFiles/simplex.dir/simplex.cpp.obj
  27. simplex.cpp
  28. 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)
  29. 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> &)'
  30. C:\cgal\git\Skin_surface_3\examples\Skin_surface_3\simplex.cpp(20): note: while trying to match the argument list '(Facet, Simplex)'
  31.  
  32. */
Add Comment
Please, Sign In to add comment