On 04/03/14 16:19, Fermín Galán Márquez wrote:

In src/lib/ngsi/Scope.cpp:

> @@ -40,8 +40,9 @@
>  */
>  Scope::Scope()
>  {
> -  type  = "";
> -  value = "";
> +  type     = "";
> +  value    = "";
> +  areaType = AreaNone;


The bug might consist in the code ignoring AreaNone...

However, I understand that as long as (as you point out) the member of orion::Circle and orion::Polygon strucs are std::string and std::vectors and bot std::string and std::vector has a constructor, the risk doesn't exist (in the same sense that it could exist if we have a not initialized int or double). Is correct?

—
Reply to this email directly or view it on GitHub<https://github.com/telefonicaid/fiware-orion/pull/258/files#r10257996>.

Yeah, if we ignore the areaType, we really don't know what we're doing.
We cannot really protect ourself against stupidity :-)
It's a little like that a laptop stops working if you remove its battery.

Jokes apart.
Yes, what you say is correct. We use only std::vector and std::string inside the structs, so their initialization is already taken care of.
Had we used int or double, we would need a constructor of our own to set them to zero to avoid surprises.


________________________________

Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx