« first day (419 days earlier)      last day (4755 days later) » 

Ell
Ell
19:00
-std=c++0x
user142019
Because it has a bug.
Ell
Ell
but my allocator.allocate(1) still doesnt work
nor does allocate()
and you know it was only about a week ago
that i realised template errors has
{aka ...}
Define "doesn't work".
@Ell: doesn't work how? Doesn't allocate memory? or compile?
Ell
Ell
that help SO MUCh
and it doesn't compile
i dont really know what i'm supposed to do with it
19:02
@StackedCrooked That sounds like something Tony uses.
what's the error?
Ell
Ell
here is the full thing
@RMartinhoFernandes That was Sexy Studio if I remember well..
Ell
Ell
|25|error: cannot convert ‘__gnu_cxx::new_allocator<int>::pointer {aka int*}’ to ‘std::map<int, Node<int>*, std::less<int>, std::allocator<std::pair<const int, Node<int>*> > >::mapped_type {aka Node<int>*}’ in assignment
error: cannot convert ‘int*’ to ‘Node<int>*’ in assignment
effectively
note to self
if you change your grammar
19:03
What type is your allocator?
don't forget to change your test case
Ell
Ell
but i dont know where to find the function signature for allocate() because cplusplus is <bad word here> apparently?
well its
:P
@Ell: can we see line 25? allocator.allocate(1) doesn't have any (obvious) pointers.
Ell
Ell
std::allocator<T>
mNodes[key] = mAllocator.allocate(1);
19:04
And the map?
Ell
Ell
mNodes is
std::map<T, Node<T>*>
You need a std::allocator<Node<T>>!
and mAllocator is a std::allocator<int> instead of... yeah that?
Ell
Ell
oh my goodness of course
i am so stupid -_-
how didn't I see that!?
you know
user142019
19:06
know what?
there's a very slim chance that actually, it wasn't a compiler bug at all
Actually, I don't.
@DeadMG Hmm, "slim"?
user142019
Rule #1: it's never a compiler bug.
Ell
Ell
i know everything
user142019
19:06
Me too.
15
Q: Is continue considered bad style?

FredOverflowI feel myself tempted to write the following nested loop: for (int i = 0; i < N; ++i) { for (int k = 0; k < N; ++k) { if (i == k) continue; // ... other stuff ... } } Would this be acceptable, or should I use if (i != k) and thus introduce another level of nes...

no, I realized that I already fixed that problem
Somehow I don't like being migrated...
it was a compiler bug
Hey guys, quick question. With GCC, what flags should I use for fastest compilation, besides -O0?
19:08
-super-fast-compilation. No idea, really.
@WTP: My code revealed a compiler bug: f:\code\utilities\typeerasure\typeerasure\tecontainer.h(611): fatal error C1063: compiler limit : compiler stack overflow
@FredOverflow I agree with the first answer.
Ell
Ell
i thought -03 was for runtime speed?
@MooingDuck That's not a bug.
That's bad QoI.
@R.Martinho: I consider that a bug.
user142019
19:08
@MooingDuck That's a limit, not a bug.
a limit you hit == a bug, especially if other implementations don't have it
user142019
My program can't allocate 2 TB of memory. That must be a bug!
@WTP: GCC compiles my program just fine
user142019
GCC ftw
Clang ftw!
19:10
@rubenvb Implementations are allowed to limit certain stuffs.
@RMartinhoFernandes this doesn't mean it doesn't make it unusable.
@WTP: MSVC just says "error instantiating this class", but it's just a template, it shouldn't be hitting any limits. The template depth should be.... 5ish
But you file a feature request to increase it, not a bug.
anyone know of a Windows implementation of __cxa_allocate_exception and __cxa_throw?
and others?
Don't expect Hell++ to compile any code with template depth >2.
19:12
@rubenvb: what are they? Google just finds a ton of bug reports
actually, I expect that Hell++ has a maximum template depth of 0
and remember, Standard library is optional
@MooingDuck SSE4 compared to what? SSE3? Or not using any multimedia extensions?
@MooingDuck they are C++ runtime functions. They are commonly implemented in libgcc or libcxxrt and the like. But these don't work on 64-bit windows. Only a dwarf2-eh 32-bit GCC has these functioning (I believe)
@DeadMG But not including that would take much fun away.
@FredOverflow: I was thinking no multimedia. I was wondering how much faster C++ could be if it could detect those and rearrange itself like JITs can
19:13
@MooingDuck It would be slow as hell.
@RMartinhoFernandes As long as CHAR_BIT is 23, everything will be fine.
user142019
I'm going to write a program in C++.
@DeadMG: It can't be slower than a JIT, and JITs do it
it would be much slower than regular C++
every cycle the JIT spends thinking about how to optimize your program is a cycle it can't spend executing
33
Q: 10 servers to administer and I'm a history major

chipandachairI am new to this forum and not familiar with the protocols but my research rates this as an authoritative repository of information. My apologies for any breaches of protocol. Through reasons that don't warrant exhaustive discussion, I find myself in charge of 10 servers: A domain controller...

19:14
by contrast, I can write SSE4 code in Visual Studio that uses SSE4 for free
@DeadMG: I don't think so. Put in some startup code that detects if they aren't available, and switches some function pointers around (like a JIT does) and then runs. Only startup cost then
Ell
Ell
once this conversation has ended can we move onto another of my allocator problems? :P
calling through function pointer is slow
WTF?
0
Q: How to meter pixel on screen

GogooI need to meter pixel on web page or on the screen. I used orange pixel meter is any other program similar to mater pixel on screen.

lol mater pixel
19:15
@DeadMG: I don't know about you, but my MSVC11 won't do SSE4, only SSE2. And then it won't run on processors without it.
@DeadMG: by function pointers I meant function addresses in the opcodes, not variables. It's still no runtime cost
I've never seen VSC generate SSE4 by itself
but it will do scalar SSE2 though
@MooingDuck Well, back in the days when MMX was brand new and I was doing graphics intensive stuff, my programs became a lot faster, factor 4 or something. But since I've never done "floating point multimedia stuff", I cannot really comment on SSE.
how does one convert a wchar_t to an int, assuming that the value of it is an int?
@TonyTheLion: int(a)
static_cast<int>(c)?
user142019
19:16
(int)mywchar
if your program is so desperate for floating-point clock cycles
Ell
Ell
static_cast<int>(wchar)
then it's time to go just go to GPGPU
Ell
Ell
reinterpret_cast<int>(wchar)
aaaargh: static_cast<int>(somewchar)
19:17
@Ell Not valid.
Ell
Ell
it was a guess :P
depending on the size of the wchar_t in question
Ell
Ell
why not though? i never use casts :P
No, you can't reinterpret_cast without pointers of references involved.
user142019
never? would be heaven
19:18
doesn't it also need some kind of virtuality?
-2
Q: C++ Program that Sends an HTTP Post-request (html example)

BuxmeI want to code a program that Would send an HTTP Post request. The only problem is that it's really hard for me to learn with no examples :(. So here is the example : Well suppose I have a site that looks like this: <html> <body> <form action="index.php?id=log2" metho...

@RMartinhoFernandes thx
Dec 2 at 3:08, by Cat Plus Plus
If you are new here, please read the newbie hints. Thank you.
@Buxme As you kindly requested, I downvoted your question.
@RMartinhoFernandes Also, you should avoid new.
19:19
@DeadMG: Java can use standard math or SSE depending on what's available. I just want my C++ to take advantage of whatever resources it can find.
@RMartinhoFernandes What do you mean by "pointers of references"?
cpx
cpx
hm, why not just int i = c?
@FredOverflow Dammit.
@FredOverflow What could he possibly mean by that?
19:19
@MooingDuck It's not worth it, in the general case. And if you're so desperate for cycles, you'll gain infinitely more from going GPGPU anyway
Why didn't you say that earlier.
Now I can't fix it.
user142019
@FredOverflow probably he meant or instead of of.
I meant "pointers or references".
@RichardPennington cool =)
Really? I'm totally surprised!
19:20
In Dutch 'of' means or. So I'm fine.
user142019
@StackedCrooked +1 for speaking Dutch.
@DeadMG: In my mind, that's more or less the same concept. Everything I said for SSE, just put GPU instead.
dit of dat
this or that ^
uh, it's not even remotely the same
GPUs don't push a tiny few more cycles, like SSE
user142019
19:21
dit of die
this or that ^
they can push hundreds or thousands more cycles than the CPU
i.e., a real performance improvement
and secondly, you cannot automatically transform CPU programs to run on the GPU
What about complex performance improvements?
so if you pass cmd line args to your pgm, they would be in argv[1], right?
I mean, the first one
And rational performance improvements?
user142019
Yes.
19:22
hell, compiler vendors find it pretty hard to automatically vectorize as it is
@WTP Die Bart, die.
Xeo
Xeo
@DeadMG VS11 claims it got better at that
@TonyTheLion A simple test would reveal that the answer is "yes".
there's a cost/benefit tradeoff here, and SSE just doesn't provide much benefit, at all
the GPU invokes a lot of cost, but one hell of a benefit
@FredOverflow yea, I'm dense today
19:23
*assuming that the task parallelizes easily...
@DeadMG: Basically, I just want backwards compatable C++ that can take advantage of newer hardware (SSE) if it exists. Not a "need" performance. Just want to beat Java.
Xeo
Xeo
But, is it actually implementation defined what exactly argv[0] contains?
Undefined? no.
@MooingDuck Well, you can want what you like, but it's not worth it. Java can't possibly compete with C++ on performance anyway.
@Xeo What else would it be?
Xeo
Xeo
19:24
@DeadMG And on security :D
@DeadMG: If C++ could do that, then Java can't beat C++ even theoretically. As it is, Java can take advantage of processor instructions that the C++ compiler didn't konw would be there.
0
Q: Android is 100% Linux and Java. But they are not Linux and Java? What are they? Microsoft Windows 95?

GoogleMy mistake steps: Android attracts me just like Microsoft Windows 95, GUI operating system did long time ago. Step 1) First impression of Android as developer was always, like its Linux and Java. So i simply went to the market and bought it to run my Java, BASH script on it. (as i was using alr...

lol someone is confused :)
Hell++ does not have the concept of executable files.
it can't beat C++ theoretically anyway
there's plenty of theoretical reasons that Java can never be as fast as C++
user142019
@Xeo 3.6.1 - 2: "and argv[0] shall be the pointer to the initial character of a ntmbs that represents the name used to invoke the program or ""."
user142019
19:25
C++11 standard
any idiot who genuinely believes that his JIT can beat the C++ compiler even in theory is, well, an idiot
@DeadMG the first one being "Java" :P
user142019
What if you have a hardware JIT?
You do already.
Do not think CPUs are dumb enough to run the code as you wrote it.
user142019
But it's possible.
19:26
ok, I'm gonna be honest, I'm in a star-whoring mood :)
Xeo
Xeo
Martinho says that CPUs are already little JITers
user142019
Well, CPUs aren't AOTers.
@WTP They are.
CPUs will speculatively execute code.
Ell
Ell
guys, with an allocator, is there any way to use "emplace" (whats it called?) semantics so instead of passing a reference to an object for to be copy constructed from, I can just past the parameters to a constructor?
19:28
CPUs will twist and turn and break your code to hide away the fact that your code sucks.
3
@Ell: of course, std::allocator::construct(p, std::move(obj_to_emplace));
Ell
Ell
basically i want to avoid having to make an object to copy
hmm, can you debug a console app with vs and pass cmd line args to it?
Ell
Ell
okay thankyou :)
19:30
@Ell: oh, that emplaces from a copy. If you don't want a copy, just give it the arguments to construct from
@TonyTheLion Yes, you can. It's somewhere on project properties or something.
Ell
Ell
oh, i didn't realise i could just pass the arguments?
you mean
construct(p, arg1, arg2, arg3)
@Ell: yes
Ell
Ell
?
wow.. i never knew that worked
@TonyTheLion: Project Properties->Configuration Properties->Debugging->Command Arguments
Ell
Ell
19:32
is having an arbritary number of template arguments called variadic templates?
variadic templates are used to implement that
@Ell: if there's an arbitrary number of template parameters, that's variadic templates
Xeo
Xeo
template<class... Args> is a variadic template
@Ell: an arbitary number of parameters of a set number of template types is not variadic templates
Ell
Ell
okay :) thanks
19:33
@RMartinhoFernandes yea found it
Xeo
Xeo
0
Q: declarations with const in c++

user1088557I have this function void Course::GradeColumn::addStudentGrade(const Student &s, int grade ) { Student* stud = new Student(s); gradesMap.insert(pair<Student, int>(*stud,grade)); } and this one void Course::addStudent(const Student &s) throw(AlreadyExistsException){ ...

Fuck, new should be locked away from programmers until they used the compiler for half a year or something...
Or until they pass a dummy test the compiler throws at them for every new
Ell
Ell
hmmmmm
i think i might switch over to smart pointers. How true is it that real c++ never has new & delete?
"real C++"? Most implementations will have new and delete, but that should all be in libraries. Not in your code.
Ell
Ell
well i often hear people say
Xeo
Xeo
@Ell It never has visible delete
19:37
it's definitely true
Ell
Ell
"real c++" never used "new" or "delete"
smart pointers all the way
else you fail
Ell
Ell
yeah obviously it has to be somewhere
okay so it would be wise to switch all of my *'s to a smart pointer?
Xeo
Xeo
Sometimes you have visible new but you can hide it away in a make_unique function for unique_ptr. There already is make_shared for shared_ptr
@Ell Not all
Not all of them blindly.
Xeo
Xeo
19:37
only the owning ones
not all. Just ones that own their data
You need to consider ownership carefully.
Ell
Ell
yeah thats what im thinking
the graph class im making is sort of like a map
@Ell: if it has ptr = new... then that should be a smart pointer
Ell
Ell
and im not sure how to go about deallocations
im using std::allocator (as you will have noticed) to allocate
19:38
@Ell: heh, I just made a hypergraph implementation earlier this week
Ell
Ell
but that just stores it in a raw pointer
il be honest; I dont know what a hypergraph is
@Ell: what's the internal data type?
Ell
Ell
:)
errrm Node<T> :P
and node is just a container that has references to all of its neighbours
@Ell: it's a graph, where each edge can connect 0-INF verticies.
Ell
Ell
well errm raw pointers to each nodes neighbours
19:40
no, the graph's data type. It has a map or vector or something inside?
Ell
Ell
waait each edge? i though edges connected 2 nodes together o.O
oh a map
@Ell: not in a hypergraph.
Ell
Ell
o.O that is crazy. what are its uses?
@Ell: std::map<std::string, std::unique_ptr<Node<T>>>. Each node will still have raw-pointers
@Ell: heck if I know. Some guy wanted one though, so I made one
Ell
Ell
oh kk
and well my problem is this
19:41
@Ell: basically, if you do everything right, all your destructors should be empty
Ell
Ell
no wait - i'm okay
all of them? o.O you mean in the Node class?
@Ell "While graph edges are pairs of nodes, hyperedges are arbitrary sets of nodes, and can therefore contain an arbitrary number of nodes." -WP
Interesting, I hadn't heard of them either.
Ell
Ell
well im still a noob c++ so il look into unique_ptr - dont know its semantics
@Ell: msdn.microsoft.com/en-us/library/ee475591.aspx. If you're doing C++ right, most destructors (in your code) should be empty
Ell
Ell
well i have never really needed destructors so far
but i've never actually finished any kind of project in c++
even though i have been attempting to programme in it for about a year
but i love it so :P
19:45
basically unique_ptr is simple: std::unique_ptr a(new Node<T>); and a.get()->node_member_func()
and when the scope ends, or the class is destructed, it automatically deletes the node for you
automagically
you don't have to do a.get()
Ell
Ell
okay
you can just do a->node_member_func();
smart pointers are drop-in replacements for raw pointers, including supporting -> operators
Ell
Ell
and now im not sure about the Node class. it contains a (raw) pointer to the programmers data
and i dont know if that should be destructed on the destruction of the node?
when in doubt, allow customization
19:47
could someone look at this crappy language I thought up: pastebin.com/kTrHfb4H
@DeadMG: not according to msdn.microsoft.com/en-us/library/ee410601.aspx, but Ell has GCC, so you're probably right there.
take a std::function<void(programmer_data*)> and call it on node destruction
@MooingDuck wtf are you on about? pointer operator-> () const;
stupid question. If something is static in a base class, does that mean they're shared across derived classes, or is there one per derived class?
Ell
Ell
hmm okay
even auto_ptr has these semantics, as does shared_ptr, it'd be a bit dumb if unique_ptr didn't support that
19:48
@DeadMG: er, oh. Hey look! Why isn't that function on the operators page or either members page?
it's on the page you linked
@DeadMG: Yeah. yeah it is :(
and it's on the members page, in the operators section
operator->
The member function returns stored_ptr.
@DeadMG: wow. yeah. I... don't know what I was thinking there
Ell
Ell
you know what i think im just going to get it to destruct the node data - it should only contain data for that node anyways
19:49
@thecoshman They can't be that strict. They have people making money off of fostering kids (and we find out later).
@Ell: Easiest is to make each Node hold a copy of the user data, instead of a pointer. Then you know when to destruct it and everything is safe.
Ell
Ell
yeah i suppose but i think i have decided that its okay to destruct it now because why would you need data of a node after the node is destructed?
@Ell: if they want something magical, they can just hand you a pointer and do whatever they want with it.
Ell
Ell
and for some reason i hate using copies :/
it seems so unecessary
@Ell: it's not as slow as you think. That's how all the C++ library works.
19:51
@DeadMG Do you use Lex and/or Yacc?
@Ell: Especially with rvalues
Ell
Ell
its not for speed reasons - it just screws with my mind
and confuses me :/
@Ell: really? I never found it so. "That one is yours and this one is mine"
Ell
Ell
but im thinking that the data associated with the node is only ever used in the node
@moo
19:52
@ManofOneWay They're low quality.
Ell
Ell
oops
@MooingDuck yeah i just cant get my head around when stuff is copied and when its not
@DeadMG In what way?
Ell
Ell
and then when are you editing the copy and when are you not
well
my expression template lexer is infinitely more modifiable and generic
with yacc
good luck building an AST using RAII nodes
@Ell: it's easier if you don't use pointers. Wherever I have a TYPE that's my object. Wherever I have const TYPE&, that's someone elses object.
19:53
they're shitty C APIs and it shows
Ell
Ell
@DeadMG there are minors present!
if they don't like it, they can leave
Ell
Ell
@MooingDuck yeah i suppose that works
okay i'm going :'(
jokes lol i dont mind
well
we did have the Meta police in here telling us to stop swearing
and ever since then, I've been twitchy about it
Ell
Ell
sorry didn't mean to upset
19:56
not your fault
fucking Meta police
The fuckers, I swear ...
Ell
Ell
:O
harhar
I like it
Ell
Ell
does anyone use code::blocks?
here
not that I know of
19:57
I've used it before
Ell
Ell
okay :P
im just wondering if anyone
I once used it on Linux. Today I always use QtCreator.
Ell
Ell
has found a way to integrate git with it
to make commiting less anoying
or does everyone just use the terminal?
codeblocks has everything you don't need and nothing you do
Terminal.
Ell
Ell
19:59
@Pubby do you think? howcome?

« first day (419 days earlier)      last day (4755 days later) »