GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


templated operators by glDaher
// in foo.h

template< typename _Ty > struct foo
    {
    void operator ()( const _Ty& _Type ) const;
    };


// in foo.cpp

#include "foo.h"

template<typename _Ty> void foo<_Ty>::operator()( const _Ty& _Type ) const
    {
    }


// in main.cpp

#include "foo.h"

int main()
    {
    foo<int> Foo;

    Foo( 5 );
    }


// linker error: error LNK2019: unresolved external symbol "public: void __thiscall foo<int>::operator()(int const &)const " (??R?$foo@H@@QBEXABH@Z) referenced in function _main