Question: I'm creating a website using wordpress and I'm trying to add a MP3 music into it.

But the music don't autoplay on mobile. And when I click on pause, the music stop, but if I scroll (on PC or mobile) the music start again and again and again.

Here the html code :

```
<figure>
<audio
    controls
    src="https://www.blog-motivation.com/wp-content/uploads/2022/04/ولنبلونكم-بشئ-من-الخوف-والجوع-ونقص-من-الاموال-والانفس-والثمرات-وبشر-الصابرين-اسلام-صبحي.mp3" autoplay>

</audio>

```

thank you

Answer: 
I think it's important to know the 3 following methods when working with lambdas.
The three firsts do essentially the same thing: storing the lambda for future use.
The other seems to be what you expect from your code: you directly call the lambda and get the result, so the return type is the type returned by the lambda.

```cpp
#include <iostream>
#include <functional>

int main()
{
    // Auto store the lambda
    auto auto_keyword = [](int a) -> int
    { return a; };
    std::cout << auto_keyword(42) << std::endl;

    // std::function store the lambda
    std::function<int(int)> std_function = [](int a) -> int
    { return a; };
    std::cout << std_function(42) << std::endl;

    // raw function pointer
    int (*raw_fptr)(int) = [](int a) -> int
    { return a; };
    std::cout << raw_fptr(42) << std::endl;

    // direct call to the lambda. (what you expect from your question)
    std::cout << ([](int a) -> int{ return a; })(42) << std::endl;

    return 0;
}

```

A lot of things happen here, and I suggest you to read at least [this page from the reference](https://en.cppreference.com/w/cpp/language/lambda) for a better understanding.
According to [cppreference](https://en.cppreference.com/w/cpp/language/lambda), (emphasize mine)

> 
> The lambda expression is a prvalue expression of unique **unnamed** non-union non-aggregate class type, known as closure type
> 
> 
> 

As the type of a lambda expression is an unnamed type you cannot use it in a declaration. That is the reason why `auto` is the common usage for a lambda.

If you want to be more explicit for the arguments and return type, you can store the lambda in a `std::function` variable:

```
std::function<HttpResponse(const HttpRequest&)> say_hello = ...

```

But `std::function` is still not really the type of the lambda (which is unnamed...), it is just the type of a variable which is able to hold that lambda, as it could old the address of a plain function.

---

For further reference, draft n4860 for C++20 says at 7.5.5.1 Closure types [expr.prim.lambda.closure] §1

> 
> The type of a lambda-expression (which is also the type of the closure object) is a unique, unnamed non-union
> class type, called the closure type ...
> 
> 
>