Boost logo

Boost :

From: Dirk Gregorius (dirk_at_[hidden])
Date: 2004-12-29 09:51:21


Thanks - the custom functor works, but I don't understand why using
boost::bind or std::bind1 fails:

Does anybody know why the compiler complains about this?

typedef shared_ptr<void> handle;
handle make_dc( HWND hWnd )
{
    handle spHandle( GetDC( hWnd ), bind( &ReleaseDC, hWnd, _1 ) );
    return handle;
}

The compiler has problems with the return_value. I will attach the
compiler output to the end of the mail. It is in german but you should
get the idea anyway.

c:\Programme\Microsoft Visual Studio .NET 2003\Visual Studio SDKs\Boost
1.32\include\boost\bind.hpp(62) : error C2039: 'result_type': Ist kein
Element von 'operator``global namespace'''
c:\Programme\Microsoft Visual Studio .NET 2003\Visual Studio SDKs\Boost
1.32\include\boost\bind.hpp(62) : error C2146: Syntaxfehler: Fehlendes
';' vor Bezeichner 'type'
c:\Programme\Microsoft Visual Studio .NET 2003\Visual Studio SDKs\Boost
1.32\include\boost\bind.hpp(62) : error C2955: 'boost::_bi::type': für
die Verwendung einer Vorlagenklasse ist eine Vorlagen-Argumentliste
erforderlich
        c:\Programme\Microsoft Visual Studio .NET 2003\Visual Studio
SDKs\Boost 1.32\include\boost\bind.hpp(111): Siehe Deklaration von
'boost::_bi::type'


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