On Wednesday, 22 July 2015 at 04:29:26 UTC, Taylor Gronka wrote:
Hi,
I have a template function, and I want it to do something if
the input variable is a list of structs, and something else if
the input is a struct.
[...]
Take a look at this thread, the poster had the same question:
http:/
On Wednesday, July 22, 2015 04:29:23 Taylor Gronka via Digitalmars-d-learn
wrote:
> I have a template function, and I want it to do something if the
> input variable is a list of structs, and something else if the
> input is a struct.
If you want a template to be different for different types, th
On Wednesday, 22 July 2015 at 05:02:59 UTC, Timon Gehr wrote:
template Uks(T){
T query(string q){
T result;
static if(is(T==S[],S)){
ulong test=result.length;
// append
S newResult;
result~=newResult;
}else{
/
On 07/22/2015 06:29 AM, Taylor Gronka wrote:
Hi,
I have a template function, and I want it to do something if the input
variable is a list of structs, and something else if the input is a struct.
1) What's the best way to test this? I suppose I can call
__traits(identifier, results) and look at
Hi,
I have a template function, and I want it to do something if the
input variable is a list of structs, and something else if the
input is a struct.
1) What's the best way to test this? I suppose I can call
__traits(identifier, results) and look at the last two characters.
2) If `T` is a l