1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

Move Explicit

This commit is contained in:
Eelco Dolstra 2020-10-26 16:58:58 +01:00
parent dc7d1322ef
commit 9d5e9ef0da
5 changed files with 20 additions and 18 deletions

View file

@ -34,4 +34,16 @@ struct OnStartup
OnStartup(T && t) { t(); }
};
/* Wrap bools to prevent string literals (i.e. 'char *') from being
cast to a bool in Attr. */
template<typename T>
struct Explicit {
T t;
bool operator ==(const Explicit<T> & other) const
{
return t == other.t;
}
};
}