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 previous 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 295 times)
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Value: no deep copy support?
Next Topic: How to know if a package is loaded
Goto Forum:
  


Current Time: Mon Jun 16 21:19:59 CEST 2025

Total time taken to generate the page: 0.03976 seconds