« first day (495 days earlier)      last day (4453 days later) » 

12:00 AM
"if it is zero exit the check and go to next statement." no.
@LearningC "if it is zero, it goes to 0."
(presumably, 0 is the subroutine)
 
@MooingDuck what is subroutine?
 
@LearningC "Implement execution of the machine instruction: CALNZ x which calls subroutine (procedure) x"
 
You want the whole solution?
 
@LearningC no, my point is, you should already know what a subroutine is.
 
If clang is the C/C++/Obj-C front end for LLVM, does compiling something for LLVM produce a native code executable, or what?
 
12:02 AM
@je4d @wilhelmtell nearly there :)
 
I don't really understand what LLVM is
 
@LearningC if you don't, you need to re-read these papers, review your notes, and/or talk to your professor.
@SethCarnegie I assume it translates from psudocode to actual native code, where CLang converts from C++(text) to that psudocode. There's a special word for it that I forgot.
 
@MooingDuck so like an architecture-independent assembly language
and then llvm turns it into real assembly language
 
@SethCarnegie yes
 
Ah I see
That's very cool
 
12:06 AM
@MooingDuck these are the only notes I have. He goes strictly with these papers.
 
@SethCarnegie from en.wikipedia.org/wiki/Intermediate_language: "The GNU Compiler Collection (GCC) uses internally several intermediate languages to simplify portability and cross-compilation. Among these languages are the historical Register Transfer Language (RTL), the tree language GENERIC, the SSA-based GIMPLE."
@LearningC you didn't take notes in class?
@SethCarnegie some compilers use C as an intermediate (CFront), and some use Java bytecode.
 
@MooingDuck There are no notes to take. He goes off topic.
 
@MooingDuck You mean IR (Intermediate Representation)? Or IF (Intermediate Form)?
 
@LearningC the more I talk to you, the more I hate your professors.
@RMartinhoFernandes are they different? I barely know what I'm talking about there.
 
@MooingDuck No, I'm just spewing names to see if any ring a bell.
 
12:08 AM
@MooingDuck He wants us to learn from the book. He said this is something he can't teach, but for you to experience it yourself.
 
@LearningC that means he's a bad teacher and he knows it.
@LearningC either way, you have to learn those papers. You have to understand subroutines, and how the microop-parts all connect to each other.
@LearningC I don't have the time to learn your chapters for you. sorry :(
 
@MooingDuck Yea I know. The thing is it is hard to understand the paper. Your really helped me understand some of it though.
 
@LearningC a subroutine (at it's simplest) is just another bit of code somewhere else
you jump to it's first instruction, and the processor begins running that instead.
 
@MooingDuck I see. ok
 
normally a subroutine will return back to where you call it from, but that doesn't seem to be part of your assignment
 
12:11 AM
@sehe I've updated the answer I posted to print &/&&/const now, as best as one can anyway
 
so if ac is zero (conditional), you need to jump to the subroutine.
 
Yea goto 0; is jumping to subroutine. I think.
 
@RMartinhoFernandes I glanced back at the wiki: "An intermediate representation (IR) is a data structure that is constructed from..." Good call on that
@LearningC yes it is
 
I'm going to sleep. Good night.
 
Stupid question, will this always print 0? struct foo { int x; foo() { std::cout << x; } };
 
12:15 AM
@je4d Cool stuff. I just posted my own answer. I fear your answer might win the clarity comparison. OTOH my answer would get my vote for background information.
@Pubby No
 
@sehe yeah, I'm just reading through yours now - got to where_are_the_arguments
 
Alright. I always forget the zero-init rules
@RMartinhoFernandes Bye
 
@Pubby As in, they don't exist for primitive types
 
@sehe i guess we'll have to leave it up to the questioner to decide.. oh wait
 
12:18 AM
@je4d I'm usually fair. I'll await further responses/comments though. I definitely think your approach using c++filt is way more pragmatic than hacking with __cxa_demangle. Also, the pretty printing comes out nicer (?) or did you format that?
@je4d Ok, posting the other Spirit answer now
 
@sehe I formatted that for readability
 
@sehe I thought they do if you initialize with empty parens?
 
@je4d Oh. You cheat!
@MooingDuck Yeah, if that is array or struct initialization, but it might require {0} for archaic reasons. Need to ask a C99 expert
 
@sehe well, i could make the code put newlines after each arg, but i'm not gonna post the code to wrap template args like that in a SO post
 
@sehe but not this? struct foo { int x; foo() : x() { std::cout << x; } };
 
12:20 AM
@je4d Would defeat the purpose of having a quick&dirty method in the back pack
@MooingDuck That is initialized to 0 alright. But is no longer POD, if I'm not mistaken (has nontrivial constructor)
 
@sehe was yours a POD? It has cout in the constructor!
 
@MooingDuck Damn it. You're right. By the way, it was never 'mine'. The first was yours too :)
 
@sehe wait, what?
 
8 mins ago, by Pubby
Stupid question, will this always print 0? struct foo { int x; foo() { std::cout << x; } };
^^ I mixed you up with Pubby. sry. Sooo... it was never 'mine'. Look at @Pubby :)
 
@sehe oh hey, you aren't Pubby. When did you switch?
 
12:24 AM
Hello.
 
@asandwhich I think I can remember your name
 
@sehe alright, i've removed my cheating (and improved it a little)
 
So @MooingDuck's code does zero-initialize?
 
Ah, yes. I have a small question about ternary operators
 
@Pubby yes
@asandwhich result = condition ? iftrue : iffalse;
 
12:26 AM
i got that
 
@asandwhich Ternary operators in general? Or the ternary operator?
 
I was wondering about how acceptable it is to nest them heavily
 
@wilhelmtell: oops. Kind of surprised that you posted that as the stereotypical 'what is wrong with my code' type of question?! I have catered a sample implementation based on your 'problem description':
 
@asandwhich if you do it we will hunt you down and eat your children
 
Now it's even more acceptable than before because of constexpr.
 
12:26 AM
Thankfully I have none.
 
#define IF(x) (x)? #define ELSE :
 
Can doing so be somewhat processor intensive?
 
I don't mind chaining them. If nesting involves brackets, then it can get pretty ugly.
 
@asandwhich In general, avoid the ternary wherever possible. It's not* faster, and it's confusing
@asandwhich no, it's the same as if statements usually
 
@asandwhich Totally not the point.
 
12:27 AM
Ok.
 
@asandwhich Modern computers can certainly deal with you inputting several ? and : characters in a row.
 
@wilhelmtell no probs, have been spending my time on this one instead:
1
A: Detecting the parameter types in a Spirit semantic action

seheI could solve the problem for this particular case (in fact we discussed options on the list), but really, this kind of 'enigmatic' error creeps up more often with Boost Spirit and it would be nice to get a handle on the general class of problems. Your first resource should be the excellent spir...

 
Ok, just wrote something, and for some reason it is maxing one core, and I do not know exactly what is causing it.
 
I knew of a guy on the internet who went by "shrdlu" for almost three years before I figured out where his name is from: en.wikipedia.org/wiki/Letter_frequency
 
I did your sample yesterday. See:
 
12:29 AM
@asandwhich Doesn't the rule of "I paid for these transistors, use them" apply?
 
yesterday, by wilhelmtell
@sehe maybe i should say what i want. i want to ignore all input, leave it exactly as is, but when i read << iwant to recognize that and what's follows until and including >>
 
@asandwhich copy constructors
 
Yes, well, I have just been trying to narrow down what is resulting in such usage
 
@asandwhich your SO profile is lacking a link to xkcd.com/149
 
Hah
I actually have that shirt.
 
user1182183
12:31 AM
Does anyone know an linux alternative for ZIP UTILS by Lucian Wischik ( pastebin.com/uiSYMHtC ) That looks close to the usage of the functions?
 
@sehe oh, I thought his name was just "a". Thats all I see on the side thing :/
 
@wilhelmtell Perhaps you could update your question with that bit so I won't look to foolish replying with an overblown sample implementation of something you didn't ask for? <grin/>
 
Gah. I feel incredibly stupid
the reason for the infinite looping and high usage is that i was using = instead of ==
So stupid.
 
user1182183
shit happens
 
user1182183
I also had a high cpu using thing, looping 32k nodes for 1 player.. I fixed it with grouping the nodes into areas of 200 x 200 game units. fixed the cpu usage
 
12:40 AM
$ cat Makefile
me:
        @true
a:
        @true
sandwich:
        @if [ `whoami` != root ]; then echo "What? Make it yourself."; else echo "Okay."; fi
$ make me a sandwich
What? Make it yourself.
$ sudo make me a sandwich
Okay.
$
4
 
user1182183
lold
 
Yeah, now the usage here is back down and everything is working. hah
 
user1182183
@R., ok where's my sandwhich?
 
user1182183
;p
 
Thanks all.
 
user1182183
12:42 AM
26 users in 10 rooms, almost my birthdate 26-10-'94 <3
 
@asandwhich -Wall -Werror
 
Capital Ws.
 
@RMartinhoFernandes I saved it once and never looked at it again (at least for gcc)
Why do GCC's logic_error and runtime_error contain a std::string while no other error class (that I found) does?
 
They're not GCC's, they're Standard. And this is mandated.
 
user1182183
Uhh I'm so happy the Windows part is done of my project, now the linux part.. ; x
 
12:47 AM
@LucDanton why is it mandated? O.o
 
@wilhelmtell posted:
0
A: Compiling a simple parser with Boost.Spirit

seheMmm. I feel that we have discussed a few more details in chat than have been reflected in the question as it is. Let me entertain you with my 'toy' implementation, complete with test cases, of a grammar that will recognized <<macros>> like this, including nested expansion of them. N...

 
> Cheers & HTH :)
Lovely.
 
@MooingDuck To clarify, it's mandated that when those exceptions are constructed from a string or string literal the what member will return a pointer to a C-style string containing the text that was passed in. So an std::string member is the simplest way to implement that.
 
@LucDanton not when the parent class already has it all implemented without std::string
 
@RMartinhoFernandes I'm in a strange mood :) Too many Spirit answers taking a little more than anticipated. Learnt a thing or two, so it was worth it (thx @je4d).
 
12:49 AM
@MooingDuck What parent class would that be?
 
@LucDanton std::exception?
 
@sehe you're welcome!
 
@MooingDuck That doesn't carry anything.
 
std::exception is only default constructible. I don't recall what the specs for what is but I'm assuming it's implementation specified.
 
It has a virtual function that returns a char const*, but it's not required to be stored in the exception object. It can be static.
 
12:50 AM
@RMartinhoFernandes really? I've never seen it implemented like that. To the spec again!
 
terminate called after throwing an instance of 'std::exception'
  what():  std::exception
Aborted
There you go.
 
@LucDanton I think it has to do with implementations that want to return static const char(&)[] as const char* without having to do allocation from a freakin' exception handler. It is about exception safety, really
 
struct foo : std::exception { char const* what() override noexcept { return "look ma, no members!"; } };
 
@LucDanton at least it is nothrow. That part is not implementation dependent
 
@sehe What has to do with that?
 
12:52 AM
Things. With stuff.
 
@RMartinhoFernandes interesting, I never noticed that it wasn't required to also hold strings. Both MSVC's and .... whatever comes with GCC have the ability to hold strings
 
@MooingDuck Are you sure?
 
@RMartinhoFernandes There's an override in C++11?
 
@EtiennedeMartel And a final, too.
 
@RMartinhoFernandes I just looked over GCC's a moment ago, yes. They have a flag for if the string should be released or not.
 
12:53 AM
My gowd.
 
@EtiennedeMartel Fsckm, what Luc said.
 
@LucDanton Sry. Missed your point again? That's twice. I thought you were saying 'why is it mandated that what() return const char*, not std::string. I think it is about exception safety
 
They really took stuff from Java and C#.
 
@RMartinhoFernandes memory tells me MSVC did the same thing
@EtiennedeMartel things that prevent errors yes
 
(Actually they should have called it sealed instead, fuck Java)
 
12:53 AM
@sehe Wut? The message you originally pointed to is not a question.
 
@EtiennedeMartel override and final are really nice.
Especially override.
 
@MooingDuck It's a well known extension, yes. At least known enough that I, a non-user, know about it.
 
@LucDanton nm. I'll head to bed
 
Anyway, specs wise std::exception is an empty class.
 
@LucDanton THINGS KNOWN +1
 
12:57 AM
It's been briefly mentioned right before that but yeah the real reason std::exception is specified like that has to do with exception-safety. Can't hold arbitrary data without risking std::bad_alloc.
std::runtime_error (and children) risk that.
 
Arrgh. Opening C++ header files on vim requires manual selection of syntax. Anyone knows what incantation can I feed to au so it picks syntax based on the folder the file is on?
 
Also, use Boost.Exception! And fight visibility issues (if using GCC)!
 
  class exception
  {
  public:
    exception() throw() { }
    virtual ~exception() throw();

    /** Returns a C-style character string describing the general cause
     *  of the current error.  */
    virtual const char* what() const throw();
  };
Straight from my <exception> header.
I don't see the ability to hold strings anywhere.
 
It may be that some version of libstdc++ replicate the MSVC extention e.g. for MinGW.
 
Also, are those members (supposed to be) noexcept now, or still throw()?
 
1:00 AM
They planned to also have that std::[i|o]stream constructor taking std::wstring (or is that const wchar_t*?), too.
@RMartinhoFernandes Mine are a macro now.
 
Given that throw is being thrown out and all...
@LucDanton #define throw() noexcept?
I'm confused.
 
    class exception
    {
    public:
      exception() _GLIBCXX_USE_NOEXCEPT { }
      virtual ~exception() _GLIBCXX_USE_NOEXCEPT;

       /** Returns a C-style character string describing the general cause
       *  of the current error.  */
      virtual const char* what() const _GLIBCXX_USE_NOEXCEPT;
    };
 
Oh, I was looking at 4.6.
 
@RMartinhoFernandes erp, I was looking at MSVC9's. I could have sworn I opened minGW's....
 
Mmh, I've given a shot at implementing tuple_element in terms of decltype(adl::get<I>(std::declval<Tuple>())) and so far it's been a disaster.
 
user1182183
1:03 AM
is there a difference if I pass -DZIP_STD or -D ZIP_STD to g++ ?
 
@RafalGrasman I only ever use the first one but I have no idea. Simplest way to know is man gcc and/or try it.
 
user1182183
okey ;x Well I first need to port some windows code
 
@RafalGrasman One takes up one more character.
:P
 
user1182183
I just read that passing -DZIP_STD makes my "windows library" 'compatible' with linux.. ; o
 
They're the same.
 
user1182183
ah ok ;p
 
Yep, error: invalid use of qualified-name '::bar'. tuple_element<0, tuple>::type works, so does tuple_element<0, tuple>::type {}, but tuple_element<0, tuple>::type::bar confuses GCC.
Substituting with std::tuple_element simply works however. Oh well.
 
Sounds very silly.
Wow, this one was hard to kill: stackoverflow.com/a/4083257/46642
 
I wasn't familiar with the error (which surprised me), but a bit of googling seems to suggest that GCC takes the final ::bar to designate a static member, not a member type.
 
@LucDanton You mean, GCC has a fever, and the only prescription is more typename?
 
1:11 AM
> error: 'bar' is not a class, namespace, or enumeration
 
Guess not.
 
Not in a dependent context.
My dependent context is in the template parameters so I get SFINAE. I got the hard error by manually tracing the steps of the instantiation.
And, again, std::tuple_element works like a charm as a drop-in replacement.
 
Stop being lazy and implement tuple_element without tricks.
 
Which is?
 
What's the point of reinventing wheels if all you do is put a plastic coating around the existing ones?
Reinvent wheels like a man.
 
user1182183
1:14 AM
demolish it with a hammer and rebuild <3
 
template<typename T> /* ??? */ foo(T&& t) { return std::get<0>(std::forward<T>(t)); } riddle me this return type.
(Would normally use ADL but let's assume I only care for std::tuple right now.)
 
I think I'm lost. What were you trying to do after all?
Also, I'm probably not in a good state to think about code. I should really be asleep.
 
Express the return type of those functions/templates that fetches a tuple element.
 
user1182183
wow Luc I didn't expect that but GCC is having problems compiling your code xD
 
Some of those templates are going to be perfect-forwarding.
 
user1182183
1:17 AM
main.cpp: In function ‘vector_type to_lines(std::istream&)’:
main.cpp:39: error: ‘move’ is not a member of ‘std’
main.cpp: In function ‘map_type to_pairs(const vector_type&)’:
main.cpp:68: error: ‘move’ is not a member of ‘std’
main.cpp:68: error: ‘move’ is not a member of ‘std’
 
decltype + declval?
 
user1182183
GCC does not have std? ; o
 
Hi, has anyone here extended python 3 with C++?
 
@RMartinhoFernandes Only works for one-liners.
Also introduces SFINAE.
 
@RafalGrasman std::move is C++11. GCC needs a flag to enable that: -std=c++0x (or -std=c+11 from 4.7 onwards).
 
1:19 AM
0
Q: Exception Handling + polymorphism, doesnt work if the exception method, doesnt work in the same class

howtechstuffworksI am trying some code like this //A.hpp class A{ public: A() {} virtual const char *message() const {return "A ERROR";} }; //B.hpp #include "A.hpp" class B:public A { public: B() {} const char *message() const {return "B ERROR";} }; //main.cpp #inclu...

I'm confused by this question
 
user1182183
how do I check my gcc/gpp version again?
 
it would appear as if the object throw is copied to a type depending on where it is caught?
 
@RMartinhoFernandes I could also point you to those metafunctions that compute things like applying a functor to a tuple. How much do you enjoy decltype/declval in your metafunctions?
 
@RMartinhoFernandes deleted by Hans Passant, Bill the Lizard♦, Marc Gravell♦, Marc Gravell♦ Nov 11 '10 at 10:23 -- WTF Marc counts for two :)
 
It seems wierd that that's the only place in the language where what an expression does depends on what you do with it's result.
 
1:20 AM
@MooingDuck Where?
 
@DeadMG throw/catch
 
@MooingDuck throw follows the same rules as return. Make of that what you will.
 
@RafalGrasman --version
 
and how does it depend?
throw throws things and catch catches them
 
@sehe Usually three normal votes, or a single mod vote are enough.
 
user1182183
1:21 AM
4.1 lold
 
@DeadMG B inherits from A. He threw a B, caught an const A&, but the most derived type of the caught object is not a B.
 
That one has four votes, three of them from mods.
@RafalGrasman Ow, that's old. No C++11 for you.
 
So the throw copied the thrown B to an A object, then unwinds to the catch
 
user1182183
yeah going to update now xD
 
@MooingDuck Really? Because I'm pretty sure that exception handling would be rather broken if that was true.
 
1:22 AM
@MooingDuck He threw an A. It's the static type of the throw that matters.
Just like return.
 
ah
so he didn't throw a B at all
 
@DeadMG It's a B, but seen through a A&.
 
@RMartinhoFernandes guess that make sense since it must copy the type, and can't know at compile time what the most derived type is.
 
user1182183
<mad> CentOS VM GOT no INTERNET omg.. ;/
 
yeah, it seems perfectly legitimate, it's exactly the same rules as return
 
1:24 AM
Another quick question, is = default the same as not declaring for virtual member functions?
 
Mmh a B is thrown and a B is indeed caught.
 
@DeadMG if you return by value, yes, got it
 
user1182183
ah fixed
 
@MooingDuck The difference is that you can't explicitly specify the throw type
 
I'm not even sure what the fuss is in fact.
 
1:25 AM
whereas when you return, you can explicitly say const A& foo()
 
@LucDanton in the question? The object he caught was not an B.
 
@MooingDuck Well, it does have some measure of consistency. But "make sense"? You yourself were thinking that both examples would print "B ERROR".
 
@RMartinhoFernandes yes, I saw the problem eventually
 
@MooingDuck The two messages are different.
 
user1182183
Ok e my PC started lying to me?
sudo yum install gcc
Package gcc-4.1.2-51.el5.i386 already installed and latest version
 
1:26 AM
@Pubby It's certainly a declaration.
@RafalGrasman Ow, what distro is that?
 
user1182183
CentOS 5
 
@RMartinhoFernandes What do you mean?
 
in this case, if I use case 1: throw a; //a is an reference of B b; OUTPUT: A ERROR

case 2: throw B(); // creates new B; OUTPUT: B ERROR
What's unexpected here?
 
@LucDanton a is a reference to a B object
 
@Pubby It will always be a declaration.
You can't have a declaration that isn't a declaration (okay, maybe @Johannes can).
 
1:28 AM
Ah I got it.
 
anyway, time to Dwarf FOrtress
 
Had a hard time aligning myself with the OP for this one.
 
@RMartinhoFernandes What's behavior of this? pastebin.com/XsLNrsMY
 
@MooingDuck For the record, just like virtual copy (aka cloning) solves copying through bases, virtual throw solves throwing through bases.
 
@LucDanton basically, we forgot that objects aren't thrown by reference
@LucDanton oh, good call. You should put that on the question
 
1:30 AM
Oh, good idea.
 
@Pubby Defines qux::~qux().
 
user1182183
[rafal@localhost AutoInstaller]$ sudo yum install gcc gcc-c++ autoconf automake
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: archive.cs.uu.nl
* extras: archive.cs.uu.nl
* updates: archive.cs.uu.nl
Setting up Install Process
Package gcc-4.1.2-51.el5.i386 already installed and latest version
Package gcc-c++-4.1.2-51.el5.i386 already installed and latest version
Package autoconf-2.59-12.noarch already installed and latest version
Package automake-1.9.6-2.3.el5.noarch already installed and latest version
 
@RMartinhoFernandes So it's the same as bar?
 
@Pubby Ok, one of us is terribly confused.
 
I am :S. Does = default on a virtual have the same effect as not declaring it at all?
 
1:32 AM
You have two destructors there that are declared but not defined (~foo and ~bar). And then you have one that is declared and defined (~qux).
 
I update paste: pastebin.com/EJUTpXPK
 
@Pubby Ah, I think I finally understand what you're asking.
 
Are those the same?
 
user1182183
@R. how do I manually install the newest GCC?
 
@Pubby Yes, the implementation you get from ~T() = default; is the same you get from not declaring the destructor.
 
1:33 AM
Ok, thanks.
 
@RafalGrasman Dunno. You can build it from source (boring and takes a long time) or find prebuilt binaries (maybe a compatible package from another distro?).
 
user1182183
I think finding it would take the most time, do you have a link ready? ; x
 
I usually just use my distro's package manager.
 
user1182183
yeah the only experience I have in linux is just yum install and make MyProject ;x
 
I see that there's a CentOS 6. Maybe you should upgrade your system? (I really don't know, I never used CentOS)
 
user1182183
1:39 AM
I can try ;o
 
user1182183
I just chose CentOS because its build a very compatible with many amount of unix systems
 
user1182183
eg CentOS build work on liinux ubuntu debian etc
 
user1182183
while ubuntu build only would work for ubuntu in some cases
 
user1182183
(That's what I've been told =P)
 
Ah. No idea. I only ever used RedHat, Gentoo, and Arch.
 
user1182183
1:44 AM
And there goes another 5 gb for torrents lol
 
user1182183
Just to download centos 6 xd
 
2:12 AM
@Xeo if you're up for testing clang let me know
 
1 message moved to bin
 
@DeadMG why you remove my message?
 
it's not ok to come in here and just dump a link to your question
this place is for chat
 
you cant even imagine how long i spent on that, and I am just trying to reach out as much as i can for opinions and insight
if you look at the question, you can see all the effort I already put into it
 
well, I hate to break it to you, but I really don't care
what I care about is that it's noise in this place
 
2:22 AM
@JohnMerlino drive by linking is against the rules
 
News flash: DeadMG doesn't care
4
@JohnMerlino what does that question have to do with C++?
 
@SethCarnegie Even if it was a C++ question, I'd still drop it
this place is the Lounge, for lounging, not the Kitchen, for serving
 
Yeah I know, just saying, it's even more random because it has nothing to do with C++
 
2:38 AM
@DeadMG: but why did you downvote in the first place?
 
I'm not entirely sure, actually
hence why I suggested your edit so that I could remove it
 
good day all, good day
 
@JohnMerlino so, you're leaving?
 
2:53 AM
Bye
 
@Pubby: I just started the Dwarf Fortress. I made a mooingduck account, but I can't add (or modify?) pages on loungecpp.wikidot.com, so I'll temporarily make a little page somewhere else to be copied over.
 
@MooingDuck You need to "join the site".
 
@MooingDuck the password to wiki is "Cat Plus Plus is the greatest person in the world"
 
oh, found the edit button
 
@RMartinhoFernandes Go to bed!
2
 
3:05 AM
@RMartinhoFernandes and how does that work?
oh, there's the button
the heck is it doing way up there?
@Pubby and I thought you were joking :/
 
user406009
Is there anyway to do some sort of unbuffered input in C++?
 
user406009
I want to get the next character from std input if available or else get '/0'
 
if available? there's no way to know if it's available
 
user406009
Well if someone has typed something in.
 
the system waits for user input
 
user406009
3:15 AM
Or at least try to get std::cin for x milliseconds.
 
you need asynchronous I/O
it's not fun and completely OS dependent
 
user406009
Yeah I know.
 
then why are you asking?
 
user406009
But is there a simple way to just get next input or '0/'?
 
go look up your OS's documentation or search for an existing ASIO library
 
user406009
3:17 AM
Darn so I am going to have to use a stupid workaround like stackoverflow.com/a/912796/406009
 
ASIO is extremely complicated for streams. Are you surprised?
 
@LucDanton I couldn't. Code was flowing.
 
user406009
Ah whatever, I guess I will just use ncurses.
 
3:44 AM
well i finally "got in" to the wiki
that cat is starting more and more to resemble the cat in dilbert series... :-)
 
user406009
3:56 AM
Just double checking, exit()ing from main will not trigger destructors?
 
doesn't matter where you exit from
 
user406009
Yeah I guess so.
 

« first day (495 days earlier)      last day (4453 days later) »