[PATCH] Explicitly initialize m_v_n and m_v_b

Holger Freyther holger at freyther.de
Thu Feb 25 17:29:43 UTC 2016


> On 25 Feb 2016, at 18:21, Max <msuraev at sysmocom.de> wrote:
> 
> I'm not familiar enough with c++ to claim that the constructor will always be called so I've left it just in case.

Then write yourself an example? e.g. something like this?

#include <iostream>

struct internalmember {
	internalmember()
		: m_v(-1)
	{
		std::cout << "internalmember called" << std::endl;
	}

	int m_v;
};


struct outerstruct {
	outerstruct()
	{
		std::cout << "outerstruct called" << std::endl;
	}
}

int main(int argc, char **argv)
{
	outerstruct str;
	return 0;
}





More information about the osmocom-net-gprs mailing list