C++ Member Functions vs Free Functions

The Interface Principle by Herb Sutter For a class X, all functions, including free functions, that both (a) “mention” X, and (b) are “supplied with” X are logically part of X, because they form part of the interface of X. For in depth discussion read Namespaces and the Interface Principle by Herb Sutter. EDIT Actually, … Read more

Is it legal to use previous function parameter to declare new one?

This is fine. The ISO C++11 Standard even gives your situation as an example. First the parameter is in scope: 3.3.3 Block scope [ basic.scope.local ] 2 The potential scope of a function parameter name (including one appearing in a lambda-declarator) or of a function-local predefined variable in a function definition (8.4) begins at its … Read more

What is a good way to automatically bind JS class methods?

Use fat arrow function in ES6 (generally called as arrow function) anotherOne = ()=> { … } Call like this onClick={this.anotherOne}; no need to bind in constuctor From the ECMA spec Any reference to arguments, super, this, or new.target within an ArrowFunction must resolve to a binding in a lexically enclosing environment. Typically this will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)