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 » U++ Library support » U++ Core » RichPickToValue PROPOSAL
RichPickToValue PROPOSAL [message #29467] Fri, 22 October 2010 09:37 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi all

there is a RawPickToValue, but no RichPickToValue..
just extended it.. maybe it should complement Value..
it's actually in the very same way as RawPickValue..


Value.h:459
	RichValueRep()                                    {}


Value.h:484
	RichValue(Rep *rep) : Value(rep) {}


Value.h:502
template <class T>
class RichPickValueRep : public RichValueRep<T> {
public:
	RichPickValueRep(pick_ T& _v)      { this->v = _v; }
	RichPickValueRep(const T& _v, int) { this->v <<= _v; }
	RichPickValueRep()                 {}
};

template <class T>
class RichPickValue : public RichValue<T> {
protected:
	typedef RichPickValueRep<T> PickRep;

public:
	RichPickValue(pick_ T& x) : RichValue<T>(new PickRep(x)) {}
	RichPickValue(const T& x, int) : RichValue<T>(new PickRep(x, 0)) {}
};


Value.h:522
template <class T>
inline Value RichPickToValue(pick_ T& data)       { return RichPickValue<T>(data); }

template <class T>
inline Value RichDeepToValue(const T& data)       { return RichPickValue<T>(data, 0); }


attached is the prepared Value.h, from current revision
  • Attachment: Value.h
    (Size: 24.40KB, Downloaded 241 times)
Re: RichPickToValue PROPOSAL [message #29469 is a reply to message #29467] Fri, 22 October 2010 09:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Fri, 22 October 2010 03:37

hi all

there is a RawPickToValue, but no RichPickToValue..
just extended it.. maybe it should complement Value..
it's actually in the very same way as RawPickValue..



Does not make too much sense, as pick types usually are not (or in fact, should not be) rich....
Re: RichPickToValue PROPOSAL [message #29470 is a reply to message #29469] Fri, 22 October 2010 10:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Side note: I can see that most of your proposals are well meant and have a lot of logic in it. Anyway, I believe we have to be careful about not putting all good ideas into U++. I do not want to end with maintaining big codebase that nobody uses. We need to keep it tight and simple. Every line of library code that is not frequently used is burden....


Re: RichPickToValue PROPOSAL [message #29473 is a reply to message #29470] Fri, 22 October 2010 10:52 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
sorry, didnt want to bother you too much with all that. i admit it's been quite a lot..
developping full time with upp i'm still not that experienced..digging code and stumbling over points ptentially buggy or not yet terminated it's kind of 'has to be complete'-feeling Smile. many times i end up seeing that upp already offers means to solve the problem in a more generic way..nevermind. i'll try to do more on myself..
Previous Topic: Value: no deep copy support?
Next Topic: How to know if a package is loaded
Goto Forum:
  


Current Time: Wed May 08 07:41:06 CEST 2024

Total time taken to generate the page: 0.01765 seconds