May 01, 2009 General » C tips (again) | |||
|---|---|---|---|
| |||
...int b) {
return a > b ? a : b;
}
typedef struct { // sizeof(Mystring) == 8
int size;
int... | |||
May 01, 2009 Learn » Re: How to get the base type of a typedef | |||
|---|---|---|---|
| |||
...itself_ may be a typedef. For instance: typedef int a; typedef a b; If you... | |||
May 01, 2009 Learn » Re: how to initialize an array of typedef-ed type? | |||
|---|---|---|---|
| |||
...different lengths.
I tried a bit more:
---
typedef long tlong ;
void main()
{
int[] x = [1... | |||
May 01, 2009 Learn » Re: How to get the base type of a typedef | |||
|---|---|---|---|
| |||
...BaseTypedef(T) {
static if( is( T BaseType1 == typedef ) )
alias BaseTypedef!(BaseType1) BaseTypedef;
else
alias T... | |||
May 01, 2009 Learn » Re: How to get the base type of a typedef | |||
|---|---|---|---|
| |||
...BaseTypedef(T)
{
static if( is( T U == typedef ) )
alias U BaseTypedef;
else
alias T BaseTypedef... | |||
May 01, 2009 Learn » Re: how to initialize an array of typedef-ed type? | |||
|---|---|---|---|
| |||
Have you actually run it and seen what the results are? If it works, well... | |||
May 01, 2009 Learn » Re: how to initialize an array of typedef-ed type? | |||
|---|---|---|---|
| |||
typedef long location ; location a[] = cast(location[])[1,2,3,4] ; Seems to work. I... | |||
May 01, 2009 Learn » Re: How to get the base type of a typedef | |||
|---|---|---|---|
| |||
See the BaseTypedef() template in the "templates" module of my dlibs (they are for Phobos... | |||
May 01, 2009 Learn » How to get the base type of a typedef | |||
|---|---|---|---|
| |||
Another question about typedef... I am using typedef long location ; Now I would like to... | |||
May 01, 2009 Learn » how to initialize an array of typedef-ed type? | |||
|---|---|---|---|
| |||
...typedef is causing me problems. The one I'm currently fighting with is initialization: typedef... | |||
Copyright © 1999-2021 by the D Language Foundation