error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’

C++03 3.10/1 says: “Every expression is either an lvalue or an rvalue.” It’s important to remember that lvalueness versus rvalueness is a property of expressions, not of objects. Lvalues name objects that persist beyond a single expression. For example, obj , *ptr , ptr[index] , and ++x are all lvalues. Rvalues are temporaries that evaporate … Read more

Why is there no OFFICIAL JavaScript reference? [closed]

It’s not like there is an official JavaScript release. All the browsers have made their own JavaScript engine – some are using the same though. But especially Internet Explorer has its own version that doesn’t support a lot of what the other browsers support, making it very difficult to make a general JavaScript reference. Edit: … Read more

Remove unused references (!= “using”)

*Note: see http://www.jetbrains.net/devnet/message/5244658 for another version of this answer. Reading through the posts, it looks like there is some confusion as to the original question. Let me take a stab at it. The original post is really asking the question: “How do I identify and remove references from one Visual Studio project to other projects/assemblies … Read more

If Python strings are immutable, why does it keep the same id if I use += to append to it?

It’s a CPython-specific optimization for the case when the str being appended to happens to have no other living references. The interpreter “cheats” in this case, allowing it to modify the existing string by reallocating (which can be in place, depending on heap layout) and appending the data directly, and often reducing the work significantly … Read more

Visual Studio: Relative Assembly References Paths

To expand upon Pavel Minaev’s original comment – The GUI for Visual Studio supports relative references with the assumption that your .sln is the root of the relative reference. So if you have a solution C:\myProj\myProj.sln, any references you add in subfolders of C:\myProj\ are automatically added as relative references. To add a relative reference … Read more

C++ Difference between std::ref(T) and T&?

Well ref constructs an object of the appropriate reference_wrapper type to hold a reference to an object. Which means when you apply: auto r = ref(x); This returns a reference_wrapper and not a direct reference to x (ie T&). This reference_wrapper (ie r) instead holds T&. A reference_wrapper is very useful when you want to … Read more

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