CopernicaMarketingSoftware/PHP-CPP — pull request #144 by valmat (2014-11-25 20:23:25+00:00)
Title: Some improvements

Hi all!
It's great that the library has grown already to version 1.2.2!
I quickly ran through the code and with fresh eyes, I saw several places that can be improved.
These improvements I represent in this Pull Request.
If you are interested, you can to consider it.

*	Variadic templates
https://github.com/valmat/PHP-CPP/commit/cf25fa0b9636d232c63f01824d66289ab9a89b81
makes the code more compact

* Marked `noexcept` all move constructors and assigment operators
(See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html)

Consider the following example
```c
#include
#include

struct A
{
A(int j) : i(j)
{
std::cout << "A("<< i << ")" << std::endl;
}
A(const A& a) : i(a.i)
{
std::cout << "A(const A& "<< i << ")" << std::endl;
}
A(A&& a) : i(a.i)
{
std::cout << "A(A&& "<< i << ")" << std::endl;
}
int i;
};

struct B
{
B(int j) : i(j)
{
std::cout << "B("<< i << ")" << std::endl;
}
B(const B& b) : i(b.i)
{
std::cout << "B(const B& "<< i << ")" << std::endl;
}
B(B&& b) noexcept : i(b.i)
{
std::cout << "B(B&& "<< i << ")" << std::endl;
}
int i;
};

std::vector f()
{
std::cout << "f()" << std::endl;
std::vector v;
v.emplace_back(1);
v.emplace_back(2);
return v;
}

std::vector g()
{
std::cout << "g()" << std::endl;
std::vector v;
v.emplace_back(3);
v.emplace_back(4);
return v;
}

int main()
{
auto va = f();
auto vb = g();
return 0;
}
```
Compile:
`g++ --std=c++11 2.cpp && ./a.out`
Output:
```
f()
A(1)
A(2)
A(const A& 1)
g()
B(3)
B(4)
B(B&& 3)
```
B(B&& b) **noexcept** allows a compiler to use move semantics in the vector container