Skip to content

CGAL geometry kernel primitives #6006

Answered by lrineau
petrasvestartas asked this question in Q&A
Discussion options

You must be logged in to vote

You question is a C++ question, and it is not specific to CGAL. All you have to know is that geometry kernel primitives are class templates, and they have copy constructors.

Copy initialization

Point a = b;

This is a copy initialization. As Point is a class, and both a and b are of type Point, and b is not a prvalue, then the copy constructor of Point is called to initialize a with a copy of b.

Direct initialization

Point a(b);

This is a direct initilization. Point is a class and both a and b are of type Point, and b is not a prvalue, then the copy constructor of Point is called to initialize a with a copy of b.

Conclusion

Point a = b;
Point aa(b);

For CGAL geometric objects, those two wa…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@petrasvestartas
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MaelRL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants