Boost logo

Boost :

From: Greg Dehaas (GregDehaas_at_[hidden])
Date: 2003-02-06 09:49:48


Hi all,

Could someone please tell me how to achieve a functor binding to a templated
function?

I have a namespace GenAlg with this inside:
--------------------------------------------------------------------
namespace GenAlg
{
        template <class TController, class TFitness>
                unsigned long RouletteWheel(TController *oController)
                {
                        ...
                }
}
--------------------------------------------------------------------

elsewhere I have a
--------------------------------------------------------------------
boost::function1<unsigned long, CGAController *> fncSelection;
--------------------------------------------------------------------

I try to set fncSelection to RouletteWheel like so:
--------------------------------------------------------------------
fncSelection = boost::bind(GenAlg::RouletteWheel<CGAController, unsigned
long>,_1);
--------------------------------------------------------------------

And my compiler's reply is:
--------------------------------------------------------------------
genetics.obj : error LNK2001: unresolved external symbol "unsigned long
__cdecl GenAlg::RouletteWheel(class CGAController *)"
(?RouletteWheel_at_GenAlg@@YAKPAVCGAController@@@Z)
--------------------------------------------------------------------

Help? Please?
I'm sure this is stupid, simple stuff for you guys, and so annoying for me
:)
Greg


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk