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 #29450 is a reply to message #29449] |
Thu, 21 October 2010 11:54   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
i thought of it. and there is a solution in the code.
i just split the function, i.e. Set:
original:
void Set(int i, const T& x, int count = 1);
split:
T& Set(int i, const T& x);
void Set(int i, const T& x, int count);
which is syntactically the same, the omited count defaults to setting only one element and returns the ref..no changes in user code. when using count, the other function evaluates.
insert is same:
void Insert(int i, const T& x, int count = 1);
split:
T& Insert(int i, const T& x);
void Insert(int i, const T& x, int count);
i'm actually working with the code for some while now, and haven't noticed any misbehavior, so the sub layers of upp deal well with it. consider it again. i think it can contribute to the comfort using upp containers, and of corse again a little bit of speed optimization at user level..and shorten the code a bit.
attached the current source based snapshot..
|
|
|
 |
|
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:29:59 CEST 2025
Total time taken to generate the page: 0.00383 seconds
|