Home » Community » U++ community news and announcements » 2023.1 alpha
Re: 2023.1 alpha [message #59874 is a reply to message #59867] |
Mon, 15 May 2023 08:43 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to previous message](theme/default/images/down.png) |
Tom1
Messages: 1217 Registered: March 2007
|
Senior Contributor |
|
|
mirek wrote on Sat, 13 May 2023 18:48Tom1 wrote on Fri, 12 May 2023 15:09Hi,
Would it be possible to add Null support for float?
I think below you can find pretty much what is needed in Core/Defs.h:
...
constexpr double DOUBLE_NULL = -std::numeric_limits<double>::infinity();
constexpr float FLOAT_NULL = -std::numeric_limits<float>::infinity();
class Nuller {
public:
operator int() const { return INT_NULL; }
operator int64() const { return INT64_NULL; }
operator double() const { return DOUBLE_NULL; }
operator float() const { return FLOAT_NULL; }
operator bool() const { return false; }
Nuller() {}
};
extern const Nuller Null;
template <class T> void SetNull(T& x) { x = Null; }
template <class T> bool IsNull(const T& x) { return x.IsNullInstance(); }
template<> inline bool IsNull(const int& i) { return i == INT_NULL; }
template<> inline bool IsNull(const int64& i) { return i == INT64_NULL; }
template<> inline bool IsNull(const double& r) { return !(std::abs(r) < std::numeric_limits<double>::infinity()); }
template<> inline bool IsNull(const float& r) { return !(std::abs(r) < std::numeric_limits<float>::infinity()); }
template<> inline bool IsNull(const bool& r ) { return false; }
...
Best regards,
Tom
Too big change in time of release, even if I thought this is a good idea (I am yet undecided). Let us discuss float at the start of the next cycle, ok?
Yes, absolutely. After this release is just fine. The need for float Null just pops up every once in a while and does not seem so ground breaking from my point of view.
Thanks and best regards,
Tom
|
|
|
![Read Message Read Message](theme/default/images/read.png) |
|
2023.1 alpha
By: mirek on Mon, 01 May 2023 19:44
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: GiuMar on Mon, 01 May 2023 21:40
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: zsolt on Tue, 02 May 2023 07:35
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: pvictor on Tue, 02 May 2023 08:11
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: mirek on Tue, 02 May 2023 20:14
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: Tom1 on Fri, 05 May 2023 14:51
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: Tom1 on Fri, 12 May 2023 10:23
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: Tom1 on Fri, 12 May 2023 15:09
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: mirek on Sat, 13 May 2023 17:48
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: Tom1 on Mon, 15 May 2023 08:43
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: mirek on Sat, 13 May 2023 17:47
|
![Read Message Read Message](theme/default/images/read.png) |
|
Re: 2023.1 alpha
By: Tom1 on Mon, 15 May 2023 08:38
|
Goto Forum:
Current Time: Mon Jun 17 15:10:26 CEST 2024
Total time taken to generate the page: 0.01242 seconds
|