mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
First hit at providing support for floats in the language.
This commit is contained in:
parent
b8258a4475
commit
14ebde5289
16 changed files with 207 additions and 23 deletions
|
@ -358,6 +358,14 @@ template<class N> bool string2Int(const string & s, N & n)
|
|||
return str && str.get() == EOF;
|
||||
}
|
||||
|
||||
/* Parse a string into a float. */
|
||||
template<class N> bool string2Float(const string & s, N & n)
|
||||
{
|
||||
std::istringstream str(s);
|
||||
str >> n;
|
||||
return str && str.get() == EOF;
|
||||
}
|
||||
|
||||
|
||||
/* Return true iff `s' ends in `suffix'. */
|
||||
bool hasSuffix(const string & s, const string & suffix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue