Main.cc: In function ‘int main()’: Main.cc:65:36: error: invalid initialization of reference of type ‘const Interval& {aka const std::pair&}’ from expression of type ‘std::vector >’ for (int i = 0; i < (int)size(X); ++i) { ^ Main.cc:36:12: note: in passing argument 1 of ‘i64 size(const Interval&)’ inline i64 size(const Interval& P) ^~~~