what is a type with value semantics?

what is a type with value semantics? and how does it differ from other types?

should types with value semantics be passed by value to a constructor or method instead const T& ref?

Last edited on
Why don't you do some fucking work yourself for once and write up a little essay telling us what you've learned about "value semantics" from googling.
it's a general computer science concept, see https://en.wikipedia.org/wiki/Value_semantics

as far as C++ is concerned, Lakos said it best at Cppcon 2015 (and elsewhere, this is just one of the more accessible links)
https://www.youtube.com/watch?v=W3xI1HJUy7Q
https://www.youtube.com/watch?v=0EvSxHxFknM

should types with value semantics be passed by value to a constructor or method instead const T& ref?
no, that has no bearing at all. see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#S-functions for argument passing guidelines.
Last edited on
listen "dutch" I do not want your "help" and please refrain from using abusive language, this forum is for decent people that care to help even regarding simple questions, no need to be offensive... you are a disgrace for this forum, never had someone so low here!
thanks a lot Cubbi, great references!!
Topic archived. No new replies allowed.