|
|
Home » U++ Library support » U++ Core » why not "T & Add(const T & x)" in all containers
Re: why not "T & Add(const T & x)" in all containers [message #27844 is a reply to message #27700] |
Fri, 06 August 2010 11:27   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
kohait00 wrote on Thu, 29 July 2010 16:17 | just a short question:
i noticed that all containers dont return a ref on the item created inside a container, when a copy Add is used: (here Array is example)
T& Add();
void Add(const T& x); //why void?
void AddPick(pick_ T& x); //why void?
T& Add(T *newt);
|
Mostly because of standard usage pattern...
It might be a little bit confusing as those variants that are taking parameter make a copy of this parameter (and would return a reference to this copy).
Also note the existence of Top() - only one more line...
But I am not strongly opposed to changing this either....
[Updated on: Fri, 06 August 2010 11:30] Report message to a moderator
|
|
|
 |
|
why not "T & Add(const T & x)" in all containers
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Tue, 03 August 2010 11:15
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Tue, 03 August 2010 16:06
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Wed, 04 August 2010 09:57
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Thu, 05 August 2010 08:35
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mrjt on Thu, 05 August 2010 09:55
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Thu, 05 August 2010 10:10
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Fri, 06 August 2010 11:27
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Fri, 06 August 2010 11:48
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Mon, 09 August 2010 08:50
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Fri, 13 August 2010 09:38
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Mon, 16 August 2010 09:06
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Mon, 30 August 2010 10:46
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Mon, 06 September 2010 10:53
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Mon, 06 September 2010 11:52
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Wed, 08 September 2010 09:00
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: rylek on Wed, 08 September 2010 10:24
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Wed, 08 September 2010 10:54
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Wed, 08 September 2010 11:30
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Fri, 17 September 2010 08:11
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Fri, 17 September 2010 09:15
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Thu, 21 October 2010 09:02
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Thu, 21 October 2010 11:10
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Thu, 21 October 2010 11:54
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Wed, 30 March 2011 10:54
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Sat, 16 April 2011 20:31
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Sun, 17 April 2011 14:46
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: mirek on Sun, 17 April 2011 21:43
|
 |
|
Re: why not "T & Add(const T & x)" in all containers
By: kohait00 on Mon, 18 April 2011 09:00
|
Goto Forum:
Current Time: Mon Aug 25 02:30:01 CEST 2025
Total time taken to generate the page: 0.07841 seconds
|
|
|