« first day (64 days earlier)      last day (4899 days later) » 

3:19 AM
Another StackOverflow problem: SO is not a good place to ask homework question. People here are not sufficiently something something to suppress the urge to post "the answer". Perhaps that has to do with SO's focus on plain answers instead of discussion.
 
3:55 AM
@AlfPSteinbach I think it is a good place to ask homework questions. I think the problem is that most people ask homework questions incorrectly, either out of ignorance or out of a desire to cheat or to avoid doing work. As long as you state in the question "I am working on a homework problem, here's what I've done so far," followed by "here's where I am stuck, do you have any hints?" or "this seems really crappy; is there an easier or cleaner way to do this?"
I mean, if someone asks a question without sufficient context, then it won't be answered correctly, homework or no homework.
 
4:35 AM
@AlfPSteinbach Yeah, that accepted answer is pretty fail. I wish it would be possible to unbounty a question--pay some of your own rep to take votes away from an answer...
 
4:57 AM
@JamesMcNellis :) rep wars! no, but some damping in the feedback system wouldn't hurt, i think. and separation of concerns. like, as it is now the OP can reward an answer with rep, but only by choosing the "correct" answer. the OP is the one least qualified to choose "correct" answer. so i think those should better be separated. and i think downvoting should be required to leave comment. anonymous could be OK. after all ordinary voting systems rely on anonymity to avoid undue influence.
 
@AlfPSteinbach: Well, the OP isn't always the least qualified, but I agree that he often is, especially if he is a beginner or if he completely doesn't understand the subject matter.
The system definitely has problems...
So, static_assert is pretty slick... With a bit of work and liberal use of <type_traits>, it looks like it's pretty easy to generate "nicer" template error messages.
 
Yeah. Andrei tried to put that together in Modern C++ Design / Loki, but it wasn't really as nice as his original static assert (which was like the subsequent one in Boost, a typedef that could be used anywhere)
 
I used Boost's static_assert a few times, but mostly for simple checks. I didn't realize how flexible the C++0x static assert was.
Being able to have my custom iterator wrapper say "IteratorT is not a forward iterator" is very handy.
 
5:13 AM
Yes. Some things to watch out for:
(1) g++ has a problem with repeated identical typedefs. problem for pre-c++0x implementations of static assert
(2) msvc has/had a problem with standard __LINE__ macro for build with option for "edit and continue" thing, was that /Zsomething? fouled up the name-generation in the original scope guard implementation. problem for workaround for (1)
 
Good to know.
 
(3) static assert that floating point is IEEE 754 (via the iec-something in numeric limits) is not guaranteed in g++, because with switch for fast math it claims IEEE 754 but only implements the binary representation
 
At the moment I am using it only for type checking.
 
oh, sorry. it's sunday morning. i have this thing about creating some numbered list every sunday morning
:-)
 
Ha ha
I like lists. Lists are too infrequently used. People like paragraphs too much.
 
 
4 hours later…
8:54 AM
@AlfPSteinbach Argh, returning raw pointers to dynamically allocated arrays? Why is this guy using a C++ compiler if he wants to code in C?
 
i think its because he actually wants to code in objective-c, but doesn't know it yet.
 
9:42 AM
hello everybody
 
 
1 hour later…
10:52 AM
@Alf i've -1'ed him too for not using shared_array
 
 
2 hours later…
sbi
12:47 PM
@JamesMcNellis However, if most questions of a certain category are phrased in what's considered a wrong form, then you really need to adjust our expectations. If most people ask homework questions wrong, we need a way to deal with this wrongness, rather than preaching to those who come to this place for one or two questions and then leave anway.
 
 
1 hour later…
2:15 PM
@sbi I don't know what a good new way to deal with the wrongness is. I am, however, totally open to ideas...
I guess one question is how aggressive one should be in poorly asked questions or questions that are obviously just people trying to get us to do their work.
 
 
7 hours later…
9:31 PM
Have you guys ever wrote in D?
 
9:41 PM
I've played around with it before.
It has garbage collection, but also allows you to manage memory yourself if you so choose.
It also has unit testing integrated into the language syntax.
 
10:27 PM
Hello
 
@wilhelmtell: Hello
@Misha: I wrote a hello world in D. Then I went back to C++. D looks like a great language, but it lacks good tooling and has a (comparatively) tiny user base.
@MichaelAngstadt It has just about everything integrated into the language syntax. If C++ looks like it was designed by committee, D looks like it was designed by some overzealous mad language designer :-D
 
What turned me off about D is the garbage collector. I didn't even get to the hello-world stage. If I'd want a garbage collector I'd be using a scripting language. In fact, I do, and I get much more than what D has to offer.
 
whats D good for , i never took a look at it really
any new featured worth looking in C++0x?
 
@James Yeah, last time I dabbled in it (which admittedly was a while ago) I remember thinking how small the API was.
 
10:42 PM
Smaller than C++'s ?!
 
yes
 
anyone played with Google's GO Programming language?
 
@wilhelmtell No, not really. You can use the entirety of the C standard library from D. The C++ standard library is off-limits for the most part. While you can use C++ classes from D, there are lot of restrictions.
@SaifalHarthi The idea is that it could be a replacement for C++ and could be used anywhere C++ is used.
 
i see , but i think thats hard to do since most code bases for top products are C\C++
 
@SaifalHarthi Yes, tons of new features. Threading, a concurrency-aware memory model, move semantics, variadic templates, auto/decltype, and a standard set of type traits. Those are just the ones that come to mind. There are lots of other great things being added.
@SaifalHarthi Yep.
 
10:49 PM
but its really interesting if D can run C++ Code so it will make the migration easier
lets hope C++0x does not break any code base
 
@SaifalHarthi It can't. It also can't link to most C++ code. It can only make use of nontemplate C++ classes that do not utilize multiple inheritance.
@SaifalHarthi It will, but only in corner cases or in ways that are easy to fix. For example, auto has been repurposed and some standard library functions are now overloaded.
 
i saw auto and nullptr and offcourse static_assert in VC++ 2010 , lamda looks ugly in C++0x
 
Oh, I forgot lambdas. I kind of like the lambda syntax.
 
well for a C# & ruby developer like me its different
its useful though
 
11:21 PM
So, I have this:
class Log {
    struct Proxy {
    };

public:
    friend Proxy& operator<<(Log::Proxy& p, int);
    Proxy debug();
};

Proxy& operator<<(Log::Proxy& p, int);
Any way to get it to work?
The problem I have is that g++ complains Log::Proxy is private.
What I want is to do something like this:
Log l;
l.debug() << 0;
There's a reason why I need a proxy, and not take a reference to Log for the insertion operator. I'm RAIIing things up here so that l.debug() << 0 << ' ' << "sup"; is atomic.
I mean, that's what I'm aiming at.
 
you can make << a non-static member function of Proxy
 
My question is, if Log::Proxy is private does it mean there's no way for it to get to user-land? Not even as an implicit temporary created by Log?
 
you can make << a non-static member function of Proxy
 
Mm. Never considered making this operator a member since the days I was a n00b. Maybe it'll work here...
Goodness. I think that solves the problem. And as a bonus, I think it eliminates the need for boost::ref() when I use it with Logger::debug()!
 

« first day (64 days earlier)      last day (4899 days later) »