Question: I want to fill this list of MyModel with async method. 
The async method returns List of MyModel.

I want to call MyClass.list in other functions. 

Code : 

```
 public static class MyClass
    {
       public static List<MyModel> list= await MyHelper.GetCache();

```

I'm getting an error : 

> 
> Severity Code Description Project File Line Suppression State
>  Error CS1992 The 'await' operator can only be used when contained
>  within a method or lambda expression marked with the 'async' modifier
> 
> 
> 

Any idea ?

Answer: 
Simple solution is to have a separate macro for each different count. Using 2-level "stringify" macro pattern (read more about it [here](https://stackoverflow.com/questions/16989730/stringification-how-does-it-work)) you can do something like this:

```
#include <iostream>
#include <sstream>

#define XSTRINGIFY(s) #s

#define STRINGARRAY1(s0) { XSTRINGIFY(s0) }
#define STRINGARRAY2(s0, s1) { XSTRINGIFY(s0), XSTRINGIFY(s1) }
#define STRINGARRAY3(s0, s1, s2) { XSTRINGIFY(s0), XSTRINGIFY(s1), XSTRINGIFY(s2) }

using namespace std;

string dumpStrings(string *array, int count) {
    stringstream ss;
    if (count > 0) {
        ss << '"' << array[0] << '"';
        for(int i = 1; i < count; ++i) {
            ss << ", \"" << array[i]<< '"';
        }
    }
    return ss.str();
}

int main()
{
    string strings1[1] = STRINGARRAY1(a);
    string strings2[2] = STRINGARRAY2(a, b);
    string strings3[3] = STRINGARRAY3(a, b, c);
    cout << "strings1: " << dumpStrings(strings1, sizeof(strings1) / sizeof(strings1[0])) << endl;
    cout << "strings2: " << dumpStrings(strings2, sizeof(strings2) / sizeof(strings2[0])) << endl;
    cout << "strings3: " << dumpStrings(strings3, sizeof(strings3) / sizeof(strings3[0])) << endl;
}

```

Output:

```
strings1: "a"
strings2: "a", "b"
strings3: "a", "b", "c"

```

If you want just one macro which takes variable number of arguments, it gets a bit messy, as shown in the other answers.
I'm not sure if this corresponds to what you're trying to achieve, but I generally use [this technique](https://stackoverflow.com/questions/9907160/how-to-convert-enum-names-to-string-in-c) to generate strings (or other lists generated from the strings like enum elements).

E.g.,

```
#define FOREACH_APPLY(GENERATE) \
        GENERATE(a)   \
        GENERATE(b)  \
        GENERATE(c)

#define GENERATE_STRING(STRING) #STRING,

std::string myStrings[] = {
    FOREACH_APPLY(GENERATE_STRING)
};

```