Re: use of typeof to determine auto type with ndslice examples

2015-12-20 Thread Jay Norwood via Digitalmars-d-learn
So, the extra confusion of the typeof(iota) Result return goes away when slicing arrays. auto a1 = new int[100]; auto t3 = a1.sliced(3,4,5); pragma(msg,typeof(t3)); //This prints Slice!(3u, int*) Slice!(3u, int*) t4 = a1.sliced(3,4,5); // and this works ok

Re: use of typeof to determine auto type with ndslice examples

2015-12-20 Thread Jay Norwood via Digitalmars-d-learn
On Monday, 21 December 2015 at 04:39:23 UTC, drug wrote: You can use alias Type = typeof(t0); Type t1 = 1000.iota.sliced(3, 4, 5); IIRC Result is the Voldemort type. You can think of it as a detail of implementation of ndslice that isn't intended to be used by a ndslice user directly. ok, we

Re: use of typeof to determine auto type with ndslice examples

2015-12-20 Thread drug via Digitalmars-d-learn
21.12.2015 07:23, Jay Norwood пишет: import std.stdio; import std.experimental.ndslice; void main() { import std.algorithm.iteration: map; import std.array: array; import std.range; import std.traits; auto t0 = 1000.iota.sliced(3, 4, 5); pragma(msg, typeof(t0));

Re: use of typeof to determine auto type with ndslice examples

2015-12-20 Thread lobo via Digitalmars-d-learn
On Monday, 21 December 2015 at 04:20:16 UTC, Jay Norwood wrote: I pulled down the std.experimental.ndslice examples and am attempting to build some of the examples and understand the types being used. I know don't need all these imports, but it is hard to guess which ones are needed, and the

Re: use of typeof to determine auto type with ndslice examples

2015-12-20 Thread Jay Norwood via Digitalmars-d-learn
import std.stdio; import std.experimental.ndslice; void main() { import std.algorithm.iteration: map; import std.array: array; import std.range; import std.traits; auto t0 = 1000.iota.sliced(3, 4, 5); pragma(msg, typeof(t0)); Slice!(3u, Result) t1 = 1000.iota.slic

use of typeof to determine auto type with ndslice examples

2015-12-20 Thread Jay Norwood via Digitalmars-d-learn
I pulled down the std.experimental.ndslice examples and am attempting to build some of the examples and understand the types being used. I know don't need all these imports, but it is hard to guess which ones are needed, and the examples often don't provide them, which I suspect is a common g