-
Notifications
You must be signed in to change notification settings - Fork 6
Add Tuparg - semi-typesafe fast variadic argument iteration support #9
base: dev
Are you sure you want to change the base?
Conversation
What's the situation of the draft? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work
@@ -0,0 +1,19 @@ | |||
#include <Printf.hpp> | |||
|
|||
#include <random> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should checkout hsd::random
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but hsd
doesn't have random_device
TODO: Typecheck individual types for |
@@ -10,7 +10,7 @@ namespace hsd { | |||
void* addr; | |||
|
|||
template <typename X> | |||
X& getnext() { | |||
X& getnext_unsafe() { | |||
assert(addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if addr
is nullptr that you really need to use an assert
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more of a safety measure. The program normally shouldn't allow this function to be called with null pointer, but if it gets called (by some other way than getnext
), then it's a debugging check, and it should be erased when compiling for release
Status: Work in progresss