Question: I am trying to create smart pointer to my function.

I have the function:

```
double returnValue(int i){
       return i;
}

```

Its pretty simple to create raw pointer:

```
double (*somePTR)(int) = &returnValue;

```

But how to make smart pointer to the function, for example `shared_ptr`?

```
auto someptr = std::make_shared<double>(&returnValue);

```

I have tried a lot of of options, but nothing works.

Answer: 
You cannot. Smart pointers are only for object pointers not function pointers.

The intent behind smart pointers is to manage dynamically allocated memory. If a smart pointer is able to determine the dynamically allocated memory can be deallocated, it does that.

There is no such thing for function pointers.
You simply can not do that. Since you don't do memory management, like allocate dynamic memory or destroy a function when it goes out of scope, for example, it does not make sense to have a smart pointer for that. Have first a look to the intention of smart pointers and when would you use them.