<Snektron>
i think the std uses something like that
<Snektron>
if you swap the allocator of one of the built in containers, it does something like `std::swap(static_cast<Allocator*>(this), static_cast<Allocator*>(other))` or something
<Snektron>
Also something with empty base class compression
<mq32>
yeah, cpp is weird
<mq32>
has somebody here have experience with lowlevel communication in linux (mac/ieee802.11 layer)?
<mq32>
i'd like to communicate out-of-band with known devices over WLAN, but cannot find much resources/documentation on that topic
marmotini_ has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
traviss has quit [Quit: Leaving]
mmx870 has joined #zig
jokoon has quit [Quit: jokoon]
benjif has joined #zig
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 252 seconds]
gonzus has joined #zig
<gonzus>
I have a question about enums. Say I have `const Dir = enum { N, S, E, W };` -- is there an idiomatic way to iterate over the four values? I tried `for (Dir) |dir| {}` but it didn't work.
<pixelherodev>
Snektron, my point is I could do that in Zig and it's defined
data-man has joined #zig
data-man has quit [Client Quit]
data-man has joined #zig
data-man has left #zig [#zig]
data-man has joined #zig
marmotini_ has quit [Remote host closed the connection]
wootehfoot has joined #zig
marmotini_ has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
marmotini_ has quit [Remote host closed the connection]
darithorn has joined #zig
jokoon has quit [Quit: jokoon]
<data-man>
gonzus, you can use std.meta.fields
<pixelherodev>
Whereas in C++ it's UB that just usually works
lunamn has quit [Quit: leaving]
lunamn has joined #zig
wootehfoot has joined #zig
doublex_ has joined #zig
ur5us has joined #zig
doublex has quit [Ping timeout: 250 seconds]
mahmudov has joined #zig
<Snektron>
deleting this is perfectly defined
rjtobin has joined #zig
shritesh has joined #zig
dimenus has quit [Remote host closed the connection]
<pixelherodev>
Snektron, in C++?
<pixelherodev>
... what about deleting this within the constructor?
<pixelherodev>
Because might be thinking of that
<Snektron>
not sure about in a constructor
frmdstryr has joined #zig
<daurnimator>
New zig task: write an NSS module
<pixelherodev>
A wat?
<daurnimator>
pixelherodev: nss. it's the magic that runs in almost every process to list users on a system/passwords/etc
<pixelherodev>
Ah
<pixelherodev>
Thanks
<daurnimator>
--> if you can getpwnam, it looks at /etc/nsswitch.conf, dlopens the relevant modules, and asks them in turn.
<daurnimator>
s/can/call/
<daurnimator>
The way e.g. ldap works, is that it adds a shared object libnss-ldap.so to your system, which is loaded into every process that ever asks for user info
<daurnimator>
--> zig is a great choice of language to write these modules in
<daurnimator>
last night I was working on a system where we ended up using libnss-pgsql.... which has been unmaintained since 2006. Would love to rewrite it in zig.
merlyndmg has joined #zig
<pixelherodev>
For structure member functions, is it better to define the first parameter (self/this/whatever you want to call it) as `T` or as `*T` if it doesn't need to modify the original?
<pixelherodev>
That is to say, is there a performance benefit to passing as a pointer?
<daurnimator>
pixelherodev: always prefer T if you can
<daurnimator>
pixelherodev: if you write T, zig gets to choose between T and *T and picks whatever is faster. if you write *T zig has no choice
<pixelherodev>
Gotcha
<pixelherodev>
Thanks!
<pixelherodev>
Then it's just a matter of whether I actually need *T here...
shritesh has quit [Quit: shritesh]
<pixelherodev>
I'm modifying an object pointed to by a field in T (e.g. self.a is an array list of which an item *in* the list is being modified)
<pixelherodev>
So I think T is fine
<pixelherodev>
Since the array list itself isn't being modified, and thus T itself *should* be unaffected by all of these changes
<pixelherodev>
So yeah, thanks
shritesh has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #zig
_whitelogger has joined #zig
<merlyndmg>
Is it possible to do a comptime assert when passing a `union(enum)` value to ensure that it is a subset of values?E.g. `std.debug.assert(op == .BoolAnd or op == .BoolOr);`
<merlyndmg>
The above is not erroring for me at compile time