If C++14 is available, you can omit the trailing return type, thus avoiding referencing a member outside function body and also making the code more compact:
auto begin() {
return identities.begin();
}
In general it's more correct to use decltype(auto)
for such forwarding methods, so return type can be a reference, though in this particular case it's the same (thanks to @Nawaz):
decltype(auto) begin() {
return identities.begin();
}