Home » Community » Newbie corner » again... use if deleted function :?
Re: again... use if deleted function :? [message #49325 is a reply to message #49324] |
Sat, 27 January 2018 15:14   |
 |
Klugier
Messages: 1100 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I believe you should clone or pick while assigning to SLU & SLE variables:
SLU = pick(combiner.GetSluVector()); <<<< ROW 192
// Sle
combiner.CombineSLE();
SLE = clone(combiner.GetSleVector();) <<<< ROW 195
The bad thing here is the code design:
VectorMap<String, Vector<Value> > &GetSluVector() { return SLU; } <<<< pick(SLU) ???
VectorMap<String, Vector<Value> > &GetSleVector() { return SLE; } <<<< pick(SLE) ???
// Add const VectorMap<String, Vector<Value>>& GetSluVector { return SLU; }
// Now somebody can call GetSluVector().Clear() that destroys your class encapsulation. The pick operation would be disallow.
// In c++11 you do not need to make space after > in template, so ">>" is valid.
// Please also consider writing your code in plain English. It can be hard for the first time, but it will percent in the future.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 27 January 2018 15:15] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Jul 13 02:45:46 CEST 2025
Total time taken to generate the page: 0.08206 seconds
|