mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Move Explicit
This commit is contained in:
parent
dc7d1322ef
commit
9d5e9ef0da
5 changed files with 20 additions and 18 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue