S
S
sabn1k2016-02-14 11:35:13
C++ / C#
sabn1k, 2016-02-14 11:35:13

What does it mean to use an intra-class initializer in a constructor?

By subject.
I was surprised when I googled this:

По запросу что значит внутриклассовый инициализатор ничего не найдено. 

Рекомендации:

Убедитесь, что все слова написаны без ошибок.
Попробуйте использовать другие ключевые слова.
Попробуйте использовать более популярные ключевые слова.
Попробуйте уменьшить количество слов в запросе.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaly, 2016-02-14
@vt4a2h

Take the book where you read it, find the original in English and google it according to the original, and not according to the attempts of translators. Well, or give the context, code, etc.

M
Mikhail Mironov, 2016-02-14
@Phobosmir

"in-class initialization"
This is a C11 feature;
When declaring a class, it was previously impossible to do something like this:

class Foo {
 public:
  int bar = 42;
 };

It was possible to initialize in a similar way the current static const int types. For everything else, initialization lists after the constructor were used. It's bad when there are a lot of designers. In the 11 standard, it is now allowed to initialize with a value immediately after the declaration in the class.

R
res2001, 2016-02-14
@res2001

Maybe you mean the list of initialization of class members in the constructor?

class A { 
int A,B;
A() : A(0), B(0) {};
...
}

If not, then more information is required. Where did you find it yourself? In what context?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question