While wrapping around an OpenGL shaders I found an issue with one of the required arguments. A standard vertex shader has a source that is copied by OpenGL into an internal representation. A simplistic one could look like this:

```
static const GLchar * vertex_shader_source[] =
{
    "#version 430 core\n",
    "void main(void)\n"
    "{",
    "    gl_Position = vec4(0.0, 0.0, 0.5, 1.0):\n",
    "}"
};

```

`GLchar` is defined as `char`, so this is essentially a cstr. I wrote a wrapper object that helps me create and destroy the shader (`GLuint` is an OpenGL handle). My problem can be broken down to look like the following function call:

```
GLuint shader_ptr = helper(GL_VERTEX_SHADER, vertex_shader_source);

```

I only need the vertex\_shader\_source for this single use. I would like to write something that uses the array initialiser to create the memory with an automatic scope. I do not want to use the C99 way of casting because I want to use the C++11 way of doing this.

`helper` is defined as follows:

```
GLuint helper(GLenum type, const GLchar * source[])
{
    GLuint shader_ptr = glCreateShader(type);
    glShaderSource(shader_ptr, 1, source, NULL);
    glCompileShader(shader_ptr);
    return shader_ptr;
}

```

Deleting is not important for this question and handled in a destructor using `glDeleteShader`.

I tried the following and it would not compile:

```
GLuint shader_ptr = helper(GL_VERTEX_SHADER,
{
    "#version 430 core\n",
    "void main(void)\n"
    "{",
    "    gl_Position = vec4(0.0, 0.0, 0.5, 1.0):\n",
    "}"
}
);

```

How can i call `helper` as a "one liner"?