mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
Ref T298, utility functions for matcher setup and more attributes to configure matching
* pick strategy if multiple there are multiple similar results * ordered results
This commit is contained in:
@@ -127,6 +127,13 @@ namespace BlackMisc
|
||||
return equalsBy(other, BlackMisc::Predicates::EqualsByMembers(k0, keys...));
|
||||
}
|
||||
|
||||
//! Pick one random element
|
||||
template <class T>
|
||||
T randomElement() const
|
||||
{
|
||||
return this->randomElements(1).front();
|
||||
}
|
||||
|
||||
//! Copy n elements from the container at random.
|
||||
Derived randomElements(int n) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user