Question: I am trying to get a webpage to load when the date and time are correct. The code I have come up with is:

```
@echo off
:repeat
set CurrentTime=%time:~0,2%.%time:~3,2%
set CurrentDate=%date:/=-%
echo.
echo %CurrentDate% %CurrentTime%
echo.
IF %CurrentTime% == Tue 08-04-2014 13.04 goto load
timeout /t 1 >nul
goto repeat
:load
start/MAX iexplore.exe"" "http://www.youtube.com.au"
timeout /t 6 >nul

```

It will work if I remove the CurrentDate and the date from the IF statement but it won't if I don't. I do need the date and time to work.
Thanks.

Answer: 
You have your answer here: <https://stackoverflow.com/a/22861890/2007142>

Quote: 

> 
> Once the last referring `shared_ptr` goes out of scope or is reset, `~Derived()` will be called and the memory released. Therefore, you don't need to make `~Base()` virtual. `unique_ptr<Base>` and `make_unique<Derived>` do not provide this feature, because they don't provide the mechanics of `shared_ptr` with respect to the deleter, because unique pointer is much simpler and aims for the lowest overhead and thus is not storing the extra function pointer needed for the deleter.
> 
> 
>
It'll work if you use the C++14 `make_unique` or write your own one like in Yakk's answer. Basically the difference between the shared pointer behavior is that you got:

```
template<
    class T,
    class Deleter = std::default_delete<T>
> class unique_ptr;

```

for `unique_pointer` and as you can see, the deleter belongs to the type. If you declare a `unique_pointer<Base>` it'll always use `std::default_delete<Base>` as default. But `make_unique` will take care of using the correct deleter for your class.

When using `shared_ptr` you got:

```
template< class Y, class Deleter >
shared_ptr( Y* ptr, Deleter d );

```

and other overloads as constructor. As you can see the default deleter for `unique_ptr` depends on the template parameter when declaring the type (unless you use `make_unique`) whilst for `shared_ptr` the deleter depends on the type passed to the constructor.

---

You can see a version that allows polymorphic delete without virtual destructor [here](http://coliru.stacked-crooked.com/a/5ef08f9761e950ed) (this version should also work in VS2012). Note that it is quite a bit hacked together and I'm currently not sure what the behavior of `unique_ptr` and `make_shared` in C++14 will be like, but I hope they'll make this easier. Maybe I'll look into the papers for the C++14 additions and see if something changed if I got the time later.