Click here to Skip to main content
15,889,403 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCJBK_View::OnDraw(CDC* p_DC) Pin
BarryPearlman27-Nov-13 10:50
BarryPearlman27-Nov-13 10:50 
AnswerRe: CJBK_View::OnDraw(CDC* p_DC) Pin
Richard MacCutchan27-Nov-13 22:10
mveRichard MacCutchan27-Nov-13 22:10 
AnswerRe: CJBK_View::OnDraw(CDC* p_DC) Pin
BarryPearlman28-Nov-13 10:28
BarryPearlman28-Nov-13 10:28 
GeneralRe: CJBK_View::OnDraw(CDC* p_DC) Pin
Richard MacCutchan28-Nov-13 22:41
mveRichard MacCutchan28-Nov-13 22:41 
QuestionFriend Operators of Template Classes Pin
Skippums27-Nov-13 7:00
Skippums27-Nov-13 7:00 
AnswerRe: Friend Operators of Template Classes Pin
Freak3027-Nov-13 22:05
Freak3027-Nov-13 22:05 
GeneralRe: Friend Operators of Template Classes Pin
Skippums29-Nov-13 14:35
Skippums29-Nov-13 14:35 
AnswerRe: Friend Operators of Template Classes Pin
Stefan_Lang27-Nov-13 22:40
Stefan_Lang27-Nov-13 22:40 
Here's something that worked for me:
C++
template <class BaseType>
class iReadContainer
{
    template <class> friend bool operator== (const iReadContainer<BaseType>& one, const iReadContainer<BaseType>& other);
};


P.S.: In previous versions of VS this didnt work either. back then I used to declare a friend helper class in such cases, e. g. :
C++
template <class T>
class vec3 {
   T val[3];
public:
   ...
   friend class vec3_operator_helper; // no template argument required
};
class vec3_operator_helper {
public:
   template <class T> static
   vec3<T> add (const vec3<T>& v1, const vec3<T>& v2); // already befriended - just access vec3 members!
};
// operator declaration
template <class T>
vec3<T> operator+(const vec3<T>& v1, const vec3<T>& v2);
// operator implementation
template <class T>
vec3<T> operator+(const vec3<T>& v1, const vec3<T>& v2) {
   return vec3_operator_helper::add(v1, v2);
}

GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)


modified 28-Nov-13 5:49am.

GeneralRe: Friend Operators of Template Classes Pin
Skippums29-Nov-13 14:34
Skippums29-Nov-13 14:34 
GeneralRe: Friend Operators of Template Classes Pin
Stefan_Lang2-Dec-13 0:17
Stefan_Lang2-Dec-13 0:17 
QuestionFindFirstFile not working Pin
sachanratnesh26-Nov-13 18:58
sachanratnesh26-Nov-13 18:58 
AnswerRe: FindFirstFile not working Pin
Jochen Arndt26-Nov-13 20:59
professionalJochen Arndt26-Nov-13 20:59 
AnswerRe: FindFirstFile not working Pin
Richard MacCutchan26-Nov-13 22:59
mveRichard MacCutchan26-Nov-13 22:59 
AnswerRe: FindFirstFile not working Pin
Gisle Vanem26-Nov-13 23:50
Gisle Vanem26-Nov-13 23:50 
AnswerRe: FindFirstFile not working Pin
Joe Woodbury27-Nov-13 4:21
professionalJoe Woodbury27-Nov-13 4:21 
QuestionRe: FindFirstFile not working Pin
David Crow30-Nov-13 15:00
David Crow30-Nov-13 15:00 
QuestionC++ Plotting utility Pin
kpks26-Nov-13 18:45
kpks26-Nov-13 18:45 
AnswerRe: C++ Plotting utility Pin
Richard Andrew x6427-Nov-13 13:10
professionalRichard Andrew x6427-Nov-13 13:10 
GeneralRe: C++ Plotting utility Pin
kpks27-Nov-13 19:06
kpks27-Nov-13 19:06 
Questionsizeof Operator Pin
Richard Andrew x6426-Nov-13 15:48
professionalRichard Andrew x6426-Nov-13 15:48 
AnswerRe: sizeof Operator Pin
«_Superman_»26-Nov-13 19:00
professional«_Superman_»26-Nov-13 19:00 
GeneralRe: sizeof Operator Pin
Richard Andrew x6427-Nov-13 8:03
professionalRichard Andrew x6427-Nov-13 8:03 
AnswerRe: sizeof Operator Pin
Erudite_Eric26-Nov-13 19:31
Erudite_Eric26-Nov-13 19:31 
GeneralRe: sizeof Operator Pin
Richard Andrew x6427-Nov-13 8:02
professionalRichard Andrew x6427-Nov-13 8:02 
AnswerRe: sizeof Operator Pin
Stefan_Lang26-Nov-13 22:20
Stefan_Lang26-Nov-13 22:20 

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.