Question: Why doesnt the following code compile?

```
#include <vector>

class Foo
{
public:
    Foo()
    { }

    virtual ~Foo()
    { }

    std::vector<int> aVec;
};

Foo bar =
{
    { 1, 2, 3, 4, 5 }
};

```

While following code compiles:

```
#include <vector>

class Foo
{
public:

    /*Foo()
    { }

    virtual*/ ~Foo()
    { }

    std::vector<int> aVec;
};

Foo bar =
{
    { 1, 2, 3, 4, 5 }
};

```

Along with the reference to language rules, please elaborate on the rationale behind those rules.

Why does the existence of contructor and virtual destructor stops from initializing?

Answer: 
The form of list initialization you are using is known as [aggregate initialization](http://en.cppreference.com/w/cpp/language/aggregate_initialization). It's used for aggregate type. One of the requirements for a type to qualify as an aggregate is that it has no user provided constructors.

By providing a constructor, the compiler will try to match the list initialization to one of the defined constructors. It will prefer a constructor taking a single [`std::initializer_list`](http://en.cppreference.com/w/cpp/utility/initializer_list). Since you do not provide one, it will try to find a constructor whos arguments match those provided by your initialization list. Since the only constructor is the default constructor which takes no arguments, no match is found.
`Foo bar = { { 1, 2, 3, 4, 5 } };` is [aggregate initialization](http://en.cppreference.com/w/cpp/language/aggregate_initialization). It is only defined for arrays and "aggregate" class types. Adding any constructor or virtual member means the type is not aggregate.