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.
> 
> 
>
```
template<typename T>
using smart_unique_ptr=std::unique_ptr<T,void(*)(void*)>;

template<class T, class...Args> smart_unique_ptr<T> make_smart_unique(Args&&...args) {
  return {new T(std::forward<Args>(args)...), [](void*t){delete (T*)t;}};
}

```

The problem is that the default deleter for `unique_ptr` calls `delete` on the stored pointer. The above stores a deleter that knows the type at construction, so when copied to base class `unique_ptr` will still delete as the child.

This adds modest overhead, as we have to dereference a pointer. In addition it denormalizes the type, as default constructed `smart_unique_ptr`s are now illegal. You can fix this with some extra work (replace a raw function pointer with a semi smart functor that at least does not crash: the function pointer, however, should be asserted to exist if the `unique` is non-empty when the deleter is invoked).