Hi all,
I came across this example, and wondered what your thoughts on it
are:
```
void main(string[] args)
{
struct Foo(float f) {
alias VAL = f;
float getF() {
return f;
}
}
Foo!(float.nan) f;
Foo!(float.nan) f2;
// This will fail at
On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote:
Hi all,
I came across this example, and wondered what your thoughts on
it are:
```
void main(string[] args)
{
struct Foo(float f) {
alias VAL = f;
float getF() {
return f;
}
}
Foo!(
On Saturday, 12 September 2015 at 15:49:23 UTC, Atila Neves wrote:
On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote:
Hi all,
I came across this example, and wondered what your thoughts on
it are:
```
void main(string[] args)
{
struct Foo(float f) {
alias VAL = f;
On Saturday, 12 September 2015 at 16:08:31 UTC, Robert wrote:
On Saturday, 12 September 2015 at 15:49:23 UTC, Atila Neves
wrote:
What do think is unusual?
Atila
It's unusual, because `float.nan != float.nan`, so one might
expect that `typeof(Foo!(float.nan) != Foo!(float.nan))`,
whereas thi
On Saturday 12 September 2015 18:08, Robert wrote:
> It's unusual, because `float.nan != float.nan`, so one might
> expect that `typeof(Foo!(float.nan) != Foo!(float.nan))`, whereas
> this is clearly not the case, even with both the static assert
> and runtime assert failing. I'm just curious t
On Saturday, 12 September 2015 at 16:08:31 UTC, Robert wrote:
assert and runtime assert failing. I'm just curious to
understand the reasoning behind this, whether it's intentional,
and whether it matters at all.
Types need to mangle to the same name, but using floats in a type
name is usually
On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote:
Hi all,
I came across this example, and wondered what your thoughts on
it are:
It seems a little unusual to me.
Robert
For what it's worth, I was investigating this initially as a
discussion about adding type-level values in
On Saturday, 12 September 2015 at 19:02:16 UTC, Robert wrote:
For what it's worth, I was investigating this initially as a
discussion about adding type-level values in Rust, and how to
handle unusual cases like this.
C++ does not allow it. And frankly, having more than a single
integer value
On Saturday, 12 September 2015 at 19:02:16 UTC, Robert wrote:
handle unusual cases like this. In the process we've managed to
break the Idris type system:
https://github.com/idris-lang/Idris-dev/issues/2609.
I don't know Idris, but you can't easily unify over floats,
because they are samples