U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » why not "T & Add(const T & x)" in all containers
why not "T & Add(const T & x)" in all containers [message #27700] Thu, 29 July 2010 22:17 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
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);


so why not having

	T&       Add();
	T&       Add(const T& x);
	T&       AddPick(pick_ T& x);
	T&       Add(T *newt);

the added elements in any case end up in the container, so their ref could be returned...


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: InitCaps() proposal
Next Topic: Incorrect implementation of INITBLOCK (and similar macros) in case when flagBLITZ is not defined.
Goto Forum:
  


Current Time: Mon May 04 20:54:18 GMT+2 2026

Total time taken to generate the page: 0.02208 seconds