Thanks to Roger Rowland, I fixed the bug in my solution.
I named a file "String.h"
which uses my template struct Ref.
Since it exists another file named <string.h>
by default in my project (from the C++ STL), the compiler took this one instead of mine and so the bug came.
A simple rename of the first one solved the problem.