|
template<typename Container , typename P > |
auto | rangeless::fn::get_unique (Container &container, P &&pred) -> decltype(*container.begin()) |
| Access unique element matching the predicate. More...
|
|
template<typename Container , typename P , typename Construct > |
auto | rangeless::fn::set_unique (Container &container, P &&pred, Construct &&con) -> decltype(*container.begin()) |
| Similar to get_unique, but end-insert an element if missing. More...
|
|
template<typename Container > |
auto | rangeless::fn::first_or_default (const Container &c) -> typename Container::value_type |
| e.g. const CConstRef<CSeq_align> aln = first_or_default( get_alns_annot(...)->Get() ); More...
|
|
template<typename Container , typename Pred > |
auto | rangeless::fn::first_or_default (const Container &c, Pred &&pred) -> typename Container::value_type |
|
template<typename Container > |
auto | rangeless::fn::last_or_default (const Container &c) -> typename Container::value_type |
|
template<typename Container , typename Pred > |
auto | rangeless::fn::last_or_default (const Container &c, Pred &&pred) -> typename Container::value_type |
|
template<typename Container , typename P >
auto rangeless::fn::get_unique |
( |
Container & |
container, |
|
|
P && |
pred |
|
) |
| -> decltype(*container.begin())
|
Access unique element matching the predicate.
Throw unless found exactly one element matching the predicate. Returns const or non-const reference depending on the constness of the container.
- See also
- set_unique
const CConstRef<CUser_object>& model_evidence_uo =
{
return uo->GetType().GetStr() == "ModelEvidence";
});
Definition at line 4370 of file fn.hpp.