Error: invalid use of 'void' (using vectors) : <p>I am trying to create a code using vectors and other c++11 utilities. The above mentioned(on the title) error occurs in my code and despite I looked for a solution to this error on the internet I did not find something that works into my code. I tried to make some type castings but did not work. I present you the contentious part of code below:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;ctime&gt;
#include &lt;cstdio&gt;
#include &lt;cstring&gt;
#include &lt;cstdlib&gt;  
#include &lt;vector&gt;
#include &lt;map&gt;
#include &lt;algorithm&gt;
#include &lt;list&gt;
//#include &lt;Winbase.h&gt;

using namespace std;

// A struct describing a product.
typedef struct Products
{
    string category;
    string name;
    float price;
} Product;

inline void scenario1(int num_cashiers)
{
    vector&lt;Product&gt; products; // It is a vector(a pseudo-second dimension) of products which will be used for each customer
    vector&lt;vector&lt;Product&gt;&gt; customers; // A vector containing all customers
    vector&lt;vector&lt;vector&lt;Product&gt;&gt;&gt; cashiers(num_cashiers); // A vector describing the supermarket cashiers declaring a queue of customers for each cashier
    double start = GetTickCount(); // It will be used for counting 10 secs until next update
    vector&lt;int&gt; total_products(num_cashiers); // A vector keeping the total number of products of each queue
    list&lt;string&gt; categories; // A list containing all the categories of the products
    list&lt;float&gt; categories_prices(categories.unique().size()); // A list containing all category prices
    //THE ABOVE LINE - THE LAST ONE IN THIS PART OF CODE - IS THE LINE I GET THE ERROR!!!
    ....

}
</code></pre>

<p>What is wrong with the code?</p>

<p>Thank you everyone in advance!</p>
