@R.MartinhoFernandes I have a hunch that it could be soooooo much simpler even with Phoenix. You know, apart from the obvious C++03 approach in my own answer
@R.MartinhoFernandes Kinda of an achievement. FWIW, I can't compile it, but it's probably something simple I missed. Technically only 45 lines of compiler messages
@Borgleader s/C++/C/; and there's your reason: win SDK didn't want to impose any data structures on any client programs. To me that might be one of the very few design choices WINAPI got right
@IDWMaster I have no clue, I just noticed that almost every school here java is the default language, with some exceptional courses in C/C++ or scripting languages.
@KillianDS I even gave the students a sheet which explained what pointers are, introduced them to C++, and went over inheritance, polymorphism, slicing, etc.
@R.MartinhoFernandes really really long long x = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
It's rare nowadays, but once in a while it still happens: I just turned on the radio in the bathroom for brushing my teeth and happened to catch the last 70secs of a song — and those few secs swept me off my feet. I only caught that they're a Scottish band, and that their album is a somehow intelligently misspelled "Something For The Weekend", so it took some googling, but I found this.
I have no idea if the rest is any good, but I so want this now.
anyone know under what conditions windows will appear to "randomly" choose a program to open a file with? Various .wav files on my computer open with audacity, WMP, or another program, seemingly randomly chosen.
@LucDanton If you ever come with something remotely palatable using Phoenix, I'll upvote it unconditionally. I'm giving up right now, I don't think it's worth it (beyond illustrating the limits of Phoenix vs. the merits of c++11 lambdas)
@JuanAntonioOrozco It's up to you to specify std::ios::binary when you open the files, but yes. Since you're just copying anyway, you might as well always use that though.
@LucDanton I'm also in C++11. I thought in my naivety that this would work:
auto first = phx::bind(&Replacer::value_type::first, arg1);
auto second = phx::bind(&Replacer::value_type::second, arg1);
std::for_each(replacer.begin(), replacer.end(),
phx::bind(first(arg1), phx::ref(hol), second(arg1)));
I tried it with phx::lambda[] for first/second too. I bet you need BOOST_PHOENIX_ADAPT_CALLABLE but it didn't appear to work. Again, I'd be missing an header, maybe
well i tried both changing std::ios::in || std::ios::binary for std::ios::in | std::ios::binary and COPY-ALGORITHM-C++-WAY works with text files but no whit binaries ones (i jusk getting the first 1k) and KISS-C++-Streambuffer-WAY giveme just tre characters (no one from the original file), what else i can try?
@Prætorian To be honest, I think largely that's largely a mistake on their part. Having signed and unsigned makes sense, but INT_PTR vs. LONG_PTR really doesn't (and I'm pretty sure in all cases those are really the same type anyway).
auto first = phx::bind(&Replacer::value_type::first, arg1);
auto second = phx::bind(&Replacer::value_type::second, arg1);
std::for_each(replacer.begin(), replacer.end(),
phx::bind(second, phx::ref(hol), first));
Aw. Gist of it is that if you define first to be bind(&value_type::first, arg1), then arg1 is already involved. A placeholder always denotes the final parameter to the final, outermost bind expression. Never a 'local' parameter to the current bind expression.
This is what makes things like bind(foo, arg1) == bind(bar, arg1) work, too. Conceptual equivalent to bind(operators::equal_to {}, first_bind_expression, second_bind_expression).
@sehe No, same rules. All the binds are really, really and I mean really similar.
I've tried making the rules different to e.g. allow for ref(f)(42) instead of the silly-looking ref(f)(arg1)(42), but it gets weird really quickly. Also I don't remember what are my current rules lol.