```c
struct Test {
int32_t a;
}
struct Test2 {
int32_t a;
Test arr[];
}
```
I need static const init Test2, then pass it to c library
late(third library, can not change the type def).
I am not sure how to do it in D.
On Wednesday, 7 November 2018 at 14:22:43 UTC, lithium iodate
wrote:
On Wednesday, 7 November 2018 at 13:05:49 UTC, test wrote:
I am confused about the bitfields order.
The bitfields start with the least significant bits:
fin -> 1
rsv1 -> 0
rsv2 -> 0
rsv3 -> 0
opcode -> 1000 = 8
mask -> 1
I am confused about the bitfields order.
mixin(bitfields!(
bool, "fin",1,
bool, "rsv1", 1,
bool, "rsv2", 1,
bool, "rsv3", 1,
Opcode, "opcode", 4,
bool, "mask", 1,
ubyte,
On Monday, 22 October 2018 at 12:32:57 UTC, test wrote:
On Monday, 22 October 2018 at 12:16:50 UTC, Stanislav Blinov
wrote:
On Monday, 22 October 2018 at 12:03:22 UTC, test wrote:
You're trying to call a static function 'getThis' on Fiber.
The type 'Fiber' is really a Proxy!FiberS. Proxy
On Monday, 22 October 2018 at 12:16:50 UTC, Stanislav Blinov
wrote:
On Monday, 22 October 2018 at 12:03:22 UTC, test wrote:
You're trying to call a static function 'getThis' on Fiber.
The type 'Fiber' is really a Proxy!FiberS. Proxy doesn't have a
static getThis() function. So the compiler
On Monday, 22 October 2018 at 11:59:21 UTC, test wrote:
On Monday, 22 October 2018 at 11:42:59 UTC, test wrote:
I try made a simple example but it has no error:
I find the way to show the error:
https://run.dlang.io/is/f8cULz
import std.traits;
struct FiberS {
static auto
On Monday, 22 October 2018 at 11:42:59 UTC, test wrote:
On Monday, 22 October 2018 at 11:18:20 UTC, Stanislav Blinov
wrote:
Error: template instance `TypeTemplate!(BaseType)` error
instantiating
I use alias this to allow call static method on proxyType.
It work some time, but on other
On Monday, 22 October 2018 at 11:18:20 UTC, Stanislav Blinov
wrote:
On Monday, 22 October 2018 at 10:49:10 UTC, test wrote:
note the added check that the member is not a type:
is(typeof(__traits(getMember, BaseType, name))).
You'll still need to iterate overloads if you want to get all
On Monday, 22 October 2018 at 10:49:10 UTC, test wrote:
On Monday, 22 October 2018 at 10:45:07 UTC, test wrote:
On Monday, 22 October 2018 at 10:29:56 UTC, Stanislav Blinov
wrote:
extern(C) void main(){
GetPub!XX;
}
https://run.dlang.io/is/f295qE
On Monday, 22 October 2018 at 10:45:07 UTC, test wrote:
On Monday, 22 October 2018 at 10:29:56 UTC, Stanislav Blinov
wrote:
On Monday, 22 October 2018 at 10:16:22 UTC, test wrote:
and
On Monday, 22 October 2018 at 10:45:07 UTC, test wrote:
test1.d
=
alias Fn1 =
On Monday, 22 October 2018 at 10:29:56 UTC, Stanislav Blinov
wrote:
On Monday, 22 October 2018 at 10:16:22 UTC, test wrote:
I try use traits get all public static function of a struct
pass to template...
how to do this ?
void allFunctions(T)() {
import std.stdio;
foreach (name;
I try use traits get all public static function of a struct pass
to template.
Compiler report " .Function is not accessible from module "
with __traits(isStaticFunction, __traits(getMember, Type , name)).
If I add " __traits(getProtection, __traits(getMember, Type,
name)) == "public"
On Wednesday, 17 October 2018 at 16:50:36 UTC, Paul Backus wrote:
On Wednesday, 17 October 2018 at 07:01:21 UTC, test wrote:
simple example: you can not use functionAttributes from betterC
test1:
module test1;
import test2;
enum X = getR(1,3);
void main(string[] args){}
test2:
module test2;
struct R {
int i;
}
R[] getR(int a, int b){
R[] r;
r ~= R(a);
r ~= R(b);
return r;
}
to build
On Wednesday, 17 October 2018 at 07:01:21 UTC, test wrote:
test2.d(3): Error: TypeInfo cannot be used with -betterC
the first problem is the error message is not clear and can be
improved.
And my question is how to workaround this to make it work with
betterC.
I need get the Route UDA only for method without (static methods,
property, constructor, destructor), dont know how to do it.
Route[] getRoutes(T)(){
Route[] routes;
foreach(int i, m; __traits(allMembers, T) ){
pragma(msg, m.stringof);
static
16 matches
Mail list logo