Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » How would you design a good copy/move semantics system?
Re: How would you design a good copy/move semantics system? [message #44166 is a reply to message #44163] Mon, 12 January 2015 19:06 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 12 January 2015 11:21
I was interested in this in general, not necessarily in the context of C++, but in the context of value based programming languages.


Well, ideologically speaking, I would say normally there are 2 types of entities:

- those than can be (deeply) copied, usually called "concrete types". Typically, not polymorphic, no abstraction. E.g. Color, Font, Value...
- those that do not have easy meaningful copy - say "identity types". Usually all polymorphic types fall into this category. E.g. File, Ctrl, ...

I like to say that U++ adds to the list 3rd type:

- containers. For these it makes sense to have both 'clone' (in case that they contain concrete types) and 'pick' semantics. 'pick', besides being optimization, nicely adds RAII compatible and MT friendly way to move identity types around.

[Updated on: Mon, 12 January 2015 19:07]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extracting links challenge
Next Topic: Banana PI
Goto Forum:
  


Current Time: Tue Apr 23 19:35:38 CEST 2024

Total time taken to generate the page: 0.02439 seconds