mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-28 16:46:16 +02:00
19 lines
318 B
C++
19 lines
318 B
C++
|
#include "english.hh"
|
||
|
|
||
|
namespace nix {
|
||
|
|
||
|
std::ostream & pluralize(
|
||
|
std::ostream & output,
|
||
|
unsigned int count,
|
||
|
const std::string_view single,
|
||
|
const std::string_view plural)
|
||
|
{
|
||
|
if (count == 1)
|
||
|
output << "1 " << single;
|
||
|
else
|
||
|
output << count << " " << plural;
|
||
|
return output;
|
||
|
}
|
||
|
|
||
|
}
|