Sun Jun 2 09:30:13 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2011-04-01

HANGOUT

2024-06-02 | 2024-05-02 | 2024-04-02 | 2024-03-02 | 2024-02-02 | 2024-01-02 | 2023-12-02 | 2023-11-02 | 2023-10-02 | 2023-09-02 | 2023-08-02 | 2023-07-02 | 2023-06-02 | 2023-05-02 | 2023-04-02 | 2023-03-02 | 2023-02-02 | 2023-01-02 | 2022-12-02 | 2022-11-02 | 2022-10-02 | 2022-09-02 | 2022-08-02 | 2022-07-02 | 2022-06-02 | 2022-05-02 | 2022-04-02 | 2022-03-02 | 2022-02-02 | 2022-01-02 | 2021-12-02 | 2021-11-02 | 2021-10-02 | 2021-09-02 | 2021-08-02 | 2021-07-02 | 2021-06-02 | 2021-05-02 | 2021-04-02 | 2021-03-02 | 2021-02-02 | 2021-01-02 | 2020-12-02 | 2020-11-02 | 2020-10-02 | 2020-09-02 | 2020-08-02 | 2020-07-02 | 2020-06-02 | 2020-05-02 | 2020-04-02 | 2020-03-02 | 2020-02-02 | 2020-01-02 | 2019-12-02 | 2019-11-02 | 2019-10-02 | 2019-09-02 | 2019-08-02 | 2019-07-02 | 2019-06-02 | 2019-05-02 | 2019-04-02 | 2019-03-02 | 2019-02-02 | 2019-01-02 | 2018-12-02 | 2018-11-02 | 2018-10-02 | 2018-09-02 | 2018-08-02 | 2018-07-02 | 2018-06-02 | 2018-05-02 | 2018-04-02 | 2018-03-02 | 2018-02-02 | 2018-01-02 | 2017-12-02 | 2017-11-02 | 2017-10-02 | 2017-09-02 | 2017-08-02 | 2017-07-02 | 2017-06-02 | 2017-05-02 | 2017-04-02 | 2017-03-02 | 2017-02-02 | 2017-01-02 | 2016-12-02 | 2016-11-02 | 2016-10-02 | 2016-09-02 | 2016-08-02 | 2016-07-02 | 2016-06-02 | 2016-05-02 | 2016-04-02 | 2016-03-02 | 2016-02-02 | 2016-01-02 | 2015-12-02 | 2015-11-02 | 2015-10-02 | 2015-09-02 | 2015-08-02 | 2015-07-02 | 2015-06-02 | 2015-05-02 | 2015-04-02 | 2015-03-02 | 2015-02-02 | 2015-01-02 | 2014-12-02 | 2014-11-02 | 2014-10-02 | 2014-09-02 | 2014-08-02 | 2014-07-02 | 2014-06-02 | 2014-05-02 | 2014-04-02 | 2014-03-02 | 2014-02-02 | 2014-01-02 | 2013-12-02 | 2013-11-02 | 2013-10-02 | 2013-09-02 | 2013-08-02 | 2013-07-02 | 2013-06-02 | 2013-05-02 | 2013-04-02 | 2013-03-02 | 2013-02-02 | 2013-01-02 | 2012-12-02 | 2012-11-02 | 2012-10-02 | 2012-09-02 | 2012-08-02 | 2012-07-02 | 2012-06-02 | 2012-05-02 | 2012-04-02 | 2012-03-02 | 2012-02-02 | 2012-01-02 | 2011-12-02 | 2011-11-02 | 2011-10-02 | 2011-09-02 | 2011-08-02 | 2011-07-02 | 2011-06-02 | 2011-05-02 | 2011-04-02 | 2011-03-02 | 2011-02-02 | 2011-01-02 | 2010-12-02 | 2010-11-02 | 2010-10-02 | 2010-09-02 | 2010-08-02 | 2010-07-02 | 2010-06-02 | 2010-05-02 | 2010-04-02 | 2010-03-02 | 2010-02-02 | 2010-01-02 | 2009-12-02 | 2009-11-02 | 2009-10-02 | 2009-09-02 | 2009-08-02 | 2009-07-02 | 2009-06-02 | 2009-05-02 | 2009-04-02 | 2009-03-02 | 2009-02-02 | 2009-01-02 | 2008-12-02 | 2008-11-02 | 2008-10-02 | 2008-09-02 | 2008-08-02 | 2008-07-02 | 2008-06-02 | 2008-05-02 | 2008-04-02 | 2008-03-02 | 2008-02-02 | 2008-01-02 | 2007-12-02 | 2007-11-02 | 2007-10-02 | 2007-09-02 | 2007-08-02 | 2007-07-02 | 2007-06-02 | 2007-05-02 | 2007-04-02 | 2007-03-02 | 2007-02-02 | 2007-01-02 | 2006-12-02 | 2006-11-02 | 2006-10-02 | 2006-09-02 | 2006-08-02 | 2006-07-02 | 2006-06-02 | 2006-05-02 | 2006-04-02 | 2006-03-02 | 2006-02-02 | 2006-01-02 | 2005-12-02 | 2005-11-02 | 2005-10-02 | 2005-09-02 | 2005-08-02 | 2005-07-02 | 2005-06-02 | 2005-05-02 | 2005-04-02 | 2005-03-02 | 2005-02-02 | 2005-01-02 | 2004-12-02 | 2004-11-02 | 2004-10-02 | 2004-09-02 | 2004-08-02 | 2004-07-02 | 2004-06-02 | 2004-05-02 | 2004-04-02 | 2004-03-02 | 2004-02-02 | 2004-01-02 | 2003-12-02 | 2003-11-02 | 2003-10-02 | 2003-09-02 | 2003-08-02 | 2003-07-02 | 2003-06-02 | 2003-05-02 | 2003-04-02 | 2003-03-02 | 2003-02-02 | 2003-01-02 | 2002-12-02 | 2002-11-02 | 2002-10-02 | 2002-09-02 | 2002-08-02 | 2002-07-02 | 2002-06-02 | 2002-05-02 | 2002-04-02 | 2002-03-02 | 2002-02-02 | 2002-01-02 | 2001-12-02 | 2001-11-02 | 2001-10-02 | 2001-09-02 | 2001-08-02 | 2001-07-02 | 2001-06-02 | 2001-05-02 | 2001-04-02 | 2001-03-02 | 2001-02-02 | 2001-01-02 | 2000-12-02 | 2000-11-02 | 2000-10-02 | 2000-09-02 | 2000-08-02 | 2000-07-02 | 2000-06-02 | 2000-05-02 | 2000-04-02 | 2000-03-02 | 2000-02-02 | 2000-01-02 | 1999-12-02

Key: Value:

Key: Value:

MESSAGE
DATE 2011-04-11
FROM Ruben Safir
SUBJECT Subject: [NYLXS - HANGOUT] C++ Workshop templated operator()<<]

as I understand things, the operator<<() needs to be external as to the
class and then declared as a friend of the class. I'm not sure if I
understand why that is the case.

I did this with a class called MESSAGE and had not trouble with the
general implementation. However, when I tried to do this with a
templated class that generally looks like, although this is not compiling

namespace stats{

template
class Distribution {
template friend std::ostream & operator<<(std::ostream &, const
Distribution&);
public:
/* ==================== LIFECYCLE ======================================= */
Distribution (T descr, int occurances = 0);
Distribution():freq(NULL),occurances(NULL){};
// Distribution ( const Distribution &other ); /* copy constructor */
// ~Distribution (); /* destructor */
/* ==================== ACCESSORS ======================================= */
T description(){ return freq;}
int population() { return occurances; }
/* ==================== MUTATORS ======================================= */
void increase_occ(){ ++occurances; std::cout << "description " << freq
<< " occurances " << occurances << std::endl; }
void descrease_occ(){ --occurances; }
/* ==================== OPERATORS ======================================= */
//Distribution& operator = ( const Distribution &other ); /* assignment
operator */
int operator()(){
return freq;
}
bool operator==(Distribution &tmp){
if(this->freq == tmp.freq)
return true;
return false;
}

bool operator<(Distribution &tmp){
if(freq < tmp.freq)
return true;
return false;
}



protected:
/* ==================== DATA MEMBERS
======================================= */
private:
/* ==================== DATA MEMBERS
======================================= */
T freq; //description of how many times found in a List
int occurances; //description of how many times a frequency was found in
a list
}; /* ----- end of class Distribution ----- */


template
std::ostream & operator << ( std::ostream & os, const Distribution &
obj )
{
T desc = obj.description();
int pop = obj.population();
os << "The Identification of " << desc << " was seens " << pop ;
return os;
} /* ----- end of function operator << ----- */


Not this is not compiling because:

test_del.cpp|90| error: passing ?const stats::Distribution? as
?this? argument of ?T stats::Distribution::description() [with T =
int]? discards qualifiers

which is on the call for the use of the << operator on the class. before
I templated
the operaotr<<(), I got a warning that I was using a non-templated
function. I've done some research and this
peoblem seems to have been common, but I don't know of any solutions,
and I don't understand what the implementation
issue is.



----- End forwarded message -----

  1. 2011-04-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop
  2. 2011-04-01 swd <sderrick-at-optonline.net> RE: [NYLXS - HANGOUT] C++ Workshop
  3. 2011-04-02 swd <sderrick-at-optonline.net> RE: [NYLXS - HANGOUT] Work
  4. 2011-04-05 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Work
  5. 2011-04-05 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] C++ Workshop
  6. 2011-04-05 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Re: double deletes C++ Workshop
  7. 2011-04-06 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [pasa-at-lib.hu: Re: [accu-general] Who uses C?]
  8. 2011-04-06 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop Calendar
  9. 2011-04-06 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop, Linked List Workshop - usenet article.
  10. 2011-04-07 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Slackware news
  11. 2011-04-07 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] Slackware news
  12. 2011-04-07 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] Slackware news
  13. 2011-04-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [jan.vipin-at-gmail.com: Re: Query about C++ Workshop]
  14. 2011-04-10 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] C++ Workshop Calendar
  15. 2011-04-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Hardware
  16. 2011-04-10 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] Hardware
  17. 2011-04-11 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop
  18. 2011-04-11 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] C++ Workshop
  19. 2011-04-11 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop templated operator()<<]
  20. 2011-04-12 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] NYLUG Workshop / Hacking Society (Smalltalk, C++, Python) Tuesday April 12 6:00PM-8:00PM
  21. 2011-04-12 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [billy.donahue-at-gmail.com: Re: templated operator()<<]
  22. 2011-04-12 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop Template, claass and function specialization
  23. 2011-04-12 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] C++ Workshop const
  24. 2011-04-15 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] Free Software Round Table TOMORROW, Saturday April 16 10-11 PM (streaming live)
  25. 2011-04-16 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] Free Software Round Table Canceled
  26. 2011-04-17 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop reminder
  27. 2011-04-18 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Happy Peasach
  28. 2011-04-19 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Happy Peasach
  29. 2011-04-19 Kevin Mark <kevin.mark-at-verizon.net> Re: [NYLXS - HANGOUT] Happy Peasach
  30. 2011-04-24 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [nbs-at-sonic.net: [vox] Fwd: Programmng the Kernel...]
  31. 2011-04-24 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] No Workshop tonight
  32. 2011-04-26 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] NYLUG Workshop / Hacking Society (Smalltalk, C++, Python) Tuesday April 26 6:00PM-8:00PM
  33. 2011-04-28 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] NYLUG Presents: 5/18 -at- 6:30PM Cameron L. Fadjo on Construct, Program, Design: Exploring Scratch From the Perspective of Computational Thinking and Cognition
  34. 2011-04-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] NYLUG Presents: 5/18 -at- 6:30PM Cameron L. Fadjo
  35. 2011-04-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] NYLUG Presents: 5/18 -at- 6:30PM Cameron L. Fadjo
  36. 2011-04-29 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] Free Software Round Table TOMORROW, Saturday April 30 10-11 PM (streaming live)
  37. 2011-04-29 Ron Guerin <ron-at-vnetworx.net> Re: [NYLXS - HANGOUT] NYLUG Presents: 5/18 -at- 6:30PM Cameron L. Fadjo
  38. 2011-04-29 einker <eminker-at-gmail.com> Subject: [NYLXS - HANGOUT] Bellingham's LinuxFest Northwest
  39. 2011-04-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Bellingham's LinuxFest Northwest
  40. 2011-04-29 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] C++ Workshop - New Webservices with OKWS - Sunday evening

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!