For starters, a more common way of declaring that line would be: const std::vector< std::vector<char> > &data;
1) Using an ampersand before data tells the compiler to make a reference to a vector. You aren't actually making a vector. This is actually not a valid reference since all references must be assigned on initialization. I don't think this will compile.
2) I'm not sure if the compiler will try to make a vector name const which will not compile either. My way is correct. I think you can also do something like: std::vector< std::vector<char> > &data() const;
Even though data isn't an actual reference, this compiles and should work correctly. When using references in a function, it takes a reference to the variable passed automagically. This is to prevent heavy pass-by-value arguments.