This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[G++] compilation error: difference between int and bool


Hello,

Could anyone explain me why

==============================
#include <vector>

class T {
  vector <bool> v;
  bool &element (int i) { return v[i]; }
};
==============================

doesn't compile?

When I replace bool with int, it compiles.

TIA.
-- 
Fabrice Bauzac


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]