Home » U++ Library support » U++ Core » How to mark std::array<T, N> moveable if only T is moveable
Re: How to mark std::array<T, N> moveable if only T is moveable [message #60702 is a reply to message #60701] |
Thu, 25 July 2024 09:19   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Lance wrote on Thu, 25 July 2024 03:16
The capability to manually mark a class might still be an asset. Suppose we receive a third party class whose objects are trivially relocatable but not trivially copyable, the simplest way to make Upp::Vector accept it is to mark it. Wrongfully marked class will usually result in immediate runtime error, hence should not be a big concern.
I disagree. They might be relocatable in that version of library with given compiler only. Immediate runtime error might happen when you do testing, but developer might not be even aware he is supposed to test it.
Also from practical point of view, this never happened 
What might be usefull though is the capability to manually mark a class to be relocated by regular move/copy constructor:
- I still think it is a good idea not to do move/copy as default option to force effectivness
- but this would allow things like Vector<std::string> with some performance penalty...
Another thing to consider: Tuple is moveable if all its components are moveable. Are we able to express that somehow? (If not, no big deal, I can make Tuple moveable and request that elements are).
Mirek
[Updated on: Thu, 25 July 2024 09:33] Report message to a moderator
|
|
|
 |
|
How to mark std::array<T, N> moveable if only T is moveable
By: busiek on Tue, 02 July 2024 17:54
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Lance on Wed, 03 July 2024 03:39
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Thu, 18 July 2024 08:41
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: busiek on Tue, 23 July 2024 18:25
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Thu, 25 July 2024 02:27
|
 |
 |
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Lance on Thu, 25 July 2024 03:16
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Thu, 25 July 2024 09:19
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Thu, 25 July 2024 09:32
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Thu, 25 July 2024 10:07
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Lance on Fri, 26 July 2024 00:00
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: busiek on Thu, 25 July 2024 17:32
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Mon, 29 July 2024 08:47
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Fri, 23 August 2024 08:54
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Thu, 18 July 2024 08:44
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: busiek on Thu, 18 July 2024 19:39
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Fri, 19 July 2024 13:11
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Lance on Fri, 19 July 2024 13:52
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Lance on Fri, 19 July 2024 14:02
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Didier on Fri, 19 July 2024 19:10
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: mirek on Mon, 22 July 2024 11:10
|
 |
|
Re: How to mark std::array<T, N> moveable if only T is moveable
By: Lance on Tue, 23 July 2024 01:07
|
Goto Forum:
Current Time: Thu Aug 07 22:09:27 CEST 2025
Total time taken to generate the page: 0.03172 seconds
|