[+] RngRange

[+] AuRng shorthand
This commit is contained in:
Reece Wilson 2022-02-20 20:25:39 +00:00
parent 9c18cb06e0
commit efe0abea90
3 changed files with 13 additions and 0 deletions

View File

@ -58,6 +58,12 @@ namespace Aurora::RNG
{
return NextArray(items.data(), items.size());
}
template<typename T>
static inline T &RngRange(const T &items)
{
return RngArray(items.begin(), items.end() - items.begin());
}
};
AUKN_SHARED_API(Random, IRandomDevice, const RandomDef &def);

View File

@ -84,4 +84,10 @@ namespace Aurora::RNG
{
return RngArray(items.data(), items.size());
}
template<typename T>
static inline T &RngRange(const T &items)
{
return RngArray(items.begin(), items.end() - items.begin());
}
}

View File

@ -85,6 +85,7 @@ namespace AuSwInfo = Aurora::SWInfo;
namespace AuIO = Aurora::IO;
namespace AuIOFS = Aurora::IO::FS;
namespace AuIONet = Aurora::IO::Net;
namespace AuRng = Aurora::RNG;
namespace AuLocale = Aurora::Locale;
namespace AuParse = Aurora::Parse;
namespace AuProcess = Aurora::Process;