The common C way to get a blob of generic data at runtime is to
use void pointers like so:
struct Structo {
int type;
void* data;
}
Then cast the void pointer to whatever data you needed based on
the type. I imagine D has a better mechanism for this sort of
thing, but after some
On Saturday, 20 January 2018 at 19:09:28 UTC, Adam D. Ruppe wrote:
On Saturday, 20 January 2018 at 19:04:06 UTC, jsako wrote:
I want to be able to filter a range based on a variable known
at runtime. Something like this:
[code]
int id = getFilterID();
auto filteredRange = filter!(a => a.id
I want to be able to filter a range based on a variable known at
runtime. Something like this:
[code]
int id = getFilterID();
auto filteredRange = filter!(a => a.id == id)(rangeToBeFiltered);
[/code]
This doesn't seem to be possible, however as .filter only takes
unary predicates. I tried:
On Thursday, 15 September 2016 at 01:40:50 UTC, Anonymouse wrote:
You mean, the literal string name of the original symbol you
passed as an alias? If so then you want the .stringof property.
void main () {
int first;
bool second;
string third;
mixin
I was making a quick mocking infrastructure for internal mocks so
I wouldn't have to pass in objects to constructors all the time
and came up with this:
[code]
mixin template internalMockRig(alias _var, string _varName, alias
_varStandard, alias _varMock) {
version(unittest)