while playing and trying to calculate total size of vector I tried something like
vector<double> vd;
auto area = vd.size()* sizeof (vd::value_type);
//Ive seen Stepanov use area as name for this kind of size, idk if he adds the sizeof vd also to area :)
Unfortunately this doesnt work...
I need to use vector<double>::value_type
but that makes code less readable.
Can it be made to work? I dont like sizeof vd.front()
because it just looks ugly to write front()
for this.
EDIT: decltype variants also fit in what I would call ugly category...