Thread safety fix: Const function returns pointer or reference to non-const object

Added new "const T& operator() const" and remove the constness of "T& operator()"