Click here to Skip to main content
16,005,169 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: develop an assembler based on reqmts in VC++ Pin
toxcct7-Jun-05 20:42
toxcct7-Jun-05 20:42 
GeneralRe: develop an assembler based on reqmts in VC++ Pin
Stlan7-Jun-05 22:59
Stlan7-Jun-05 22:59 
GeneralRe: develop an assembler based on reqmts in VC++ Pin
ThatsAlok7-Jun-05 23:05
ThatsAlok7-Jun-05 23:05 
GeneralVB/C++ DLL calls Pin
Member 20276077-Jun-05 16:54
Member 20276077-Jun-05 16:54 
Generaltemplates + overloading ofstream = AHH! Pin
FocusedWolf7-Jun-05 16:46
FocusedWolf7-Jun-05 16:46 
GeneralRe: templates + overloading ofstream = AHH! Pin
Christian Graus7-Jun-05 17:07
protectorChristian Graus7-Jun-05 17:07 
GeneralRe: templates + overloading ofstream = AHH! Pin
FocusedWolf7-Jun-05 17:21
FocusedWolf7-Jun-05 17:21 
GeneralRe: templates + overloading ofstream = AHH! Pin
Bob Stanneveld7-Jun-05 21:00
Bob Stanneveld7-Jun-05 21:00 
Hello,

The following code works for me on a VC compiler:
// prototype
template<class> class Template;

template< class T >
std::ostream& operator << (std::ostream& ost, Template<T> value)
{
	return ost << value.m_t;
}

template <class T>
class Template
{
public:

        template<class T>
	friend std::ostream& operator <<(std::ostream& ost, Template<T> value);

private:
	T	m_t;
};


The point is that you use a template parameter in a non-template function declaration. Therefore you have to make your operator a template function too.

Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralRe: templates + overloading ofstream = AHH! Pin
FocusedWolf8-Jun-05 3:59
FocusedWolf8-Jun-05 3:59 
GeneralRe: templates + overloading ofstream = AHH! Pin
Bob Stanneveld8-Jun-05 4:10
Bob Stanneveld8-Jun-05 4:10 
GeneralNeed to notify the parent dialog when in-place edit of CListCtrl takes place... Pin
Anonymous7-Jun-05 16:45
Anonymous7-Jun-05 16:45 
GeneralRe: Need to notify the parent dialog when in-place edit of CListCtrl takes place... Pin
Christian Graus7-Jun-05 17:18
protectorChristian Graus7-Jun-05 17:18 
GeneralRe: Need to notify the parent dialog when in-place edit of CListCtrl takes place... Pin
Anonymous7-Jun-05 19:17
Anonymous7-Jun-05 19:17 
GeneralNeeded some help in programming... Pin
Member 20247577-Jun-05 15:24
Member 20247577-Jun-05 15:24 
GeneralRe: Needed some help in programming... Pin
Christian Graus7-Jun-05 15:38
protectorChristian Graus7-Jun-05 15:38 
GeneralRe: Needed some help in programming... Pin
Member 20247577-Jun-05 15:47
Member 20247577-Jun-05 15:47 
GeneralRe: Needed some help in programming... Pin
Christian Graus7-Jun-05 15:49
protectorChristian Graus7-Jun-05 15:49 
GeneralCapture Video through DirectShow on WinCE Pin
gao20047-Jun-05 14:52
gao20047-Jun-05 14:52 
GeneralRe: Capture Video through DirectShow on WinCE Pin
FlyingTinman7-Jun-05 22:12
FlyingTinman7-Jun-05 22:12 
GeneralRe: Capture Video through DirectShow on WinCE Pin
gao20048-Jun-05 16:17
gao20048-Jun-05 16:17 
GeneralRe: Capture Video through DirectShow on WinCE Pin
gao20048-Jun-05 19:13
gao20048-Jun-05 19:13 
GeneralRe: Capture Video through DirectShow on WinCE Pin
gao200411-Jun-05 16:27
gao200411-Jun-05 16:27 
QuestionHelp!!! What does this program do? Pin
Member 19923037-Jun-05 14:33
Member 19923037-Jun-05 14:33 
AnswerRe: Help!!! What does this program do? Pin
Christian Graus7-Jun-05 14:44
protectorChristian Graus7-Jun-05 14:44 
GeneralRe: Help!!! What does this program do? Pin
Member 19923037-Jun-05 15:36
Member 19923037-Jun-05 15:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.