LINUX.ORG.RU

История изменений

Исправление former_anonymous, (текущая версия) :

Полный текст же наверное такой:
The listed names must be preceded by & to be captured by reference

нет:

[=, capture-list]: implicitly capture by value all local variables with names not mentioned in
the list. The capture list cannot contain this. The listed names must be preceded by &. Variables named in the capture list are captured by reference.



тут может быть логической ошибкой

тут нет логической ошибки, т.к. sqrt в C++11 имеет перегрузки для integral types, включая int, не говоря уже о возможности implicit conversion из int в double:

double sqrt (T x);

Additional overloads are provided in this header (<cmath>) for the integral types: These overloads effectively cast x to a double before calculations (defined for T being any integral type)

Исходная версия former_anonymous, :

Полный текст же наверное такой:
The listed names must be preceded by & to be captured by reference

нет:

[=, capture-list]: implicitly capture by value all local variables with names not mentioned in
the list. The capture list cannot contain this. The listed names must be preceded by &. Variables named in the capture list are captured by reference.



тут может быть логической ошибкой

тут нет логической ошибки, т.к. sqrt в C++11 имеет перегрузки для integral types, включая int, не говоря уже о возможности implicit conversion из int в double:

Additional overloads are provided in this header (<cmath>) for the integral types: These overloads effectively cast x to a double before calculations (defined for T being any integral type)