moved decltype from template to signature. Tested with online visual c++ compiler with a simpler example.