Skip to content

Is storage iterator return type supposed to differ with where usage? #778

Answered by fnc12
eclarkso asked this question in Q&A
Discussion options

You must be logged in to vote

it is not a bug cause storage.iterate function returns view_t<...giant type...> where 'giant type' depends on arguments you pass. The first case has no arguments, the second has. You'll meet the same logic if you write a code like this:

auto wh = where(in(&Obj::id, ids));
wh = where(is_equal(&Obj::id, 5));  // compilation error will happen on this line

You'll get compilation error cause where_t which is returned by where function has different template arguments -> it means that these two type returned by where(in(&Obj::id, ids)) and where(is_equal(&Obj::id, 5)) are different.
Why get_all returns the same type with where and without it? Cause this is a feature documented and guaranteed by s…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@eclarkso
Comment options

@fnc12
Comment options

@eclarkso
Comment options

@fnc12
Comment options

Answer selected by eclarkso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants