« first day (1814 days earlier)      last day (3134 days later) » 

8:03 AM
Guys, when I run this:

std::vector<path> result;

auto paths = fs::directory_iterator(start);

for (auto& d : paths) {
if (IsDirectory(d)) {
result.push_back(d);
}
}

return result;

do I in fact should replace `auto&` with `auto` so that a copy was performed or this code for some reason is already "fine"?
 
@ThePhD The problematic part in that message is "always".
You are always free to write read<T> and write<T> thingies.
 
@Griwes If you're trying to make a system that doesn't reimplement all of the stream functionality ever, you're kind of bolted on to using >> and <<.
 
Err.
You can have read<T> for a specific type with no problems (and with the rest of the system not knowing about it)...
 
Mmm.
 
8:26 AM
And, there.
Returned homework from C++ Professor in under 8 hours.
EAT IT, PROFESSOR.
And now I can sleep.
 
user1804599
hi
 
Hi.
 
Xeo
8:51 AM
@ThePhD provide an extension point that takes a stream and a type, and gives you a value of that type. Make two defaults, one with default-init then >>, and one that uses T(stream) (both SFINAE'd, of course).
That's about as much as you can do
 
T(stream) feels a bit heavy-handed...
.... Meh.
 
Xeo
extension points and sensible defaults vOv
at some point, you must have default-constructed objects that are read from the stream and then passed as arguments to some ctor, I think.
or raw bytes that are reinterpret_casted may also be possible
 
Default-init, all the way down...
 
user1804599
cool
 
9:08 AM
So
Why can't we deduce a class template parameter from the constructor?
 
I thought we can in C++14 or something?
 
@slaphappy [duplicate]
 
There was a proposal AFAIK
 
@fredoverflow There's a proposal for 17
 
@elyse Today is gonna be Scala porn day for me :-D
 
user1804599
9:23 AM
Getter and setter in one line in Perl: sub x : lvalue { shift->{x} }.
 
What does "deduce a class template parameter from the constructor" mean?
 
@elyse just compiled & ran hello world
 
user1804599
@ThePhD that you can write std::pair(1, 2) instead of std::pair<int, int>(1, 2).
 
user1804599
@JohanLarsson yay!
 
That's...
Weird.
 
9:25 AM
@fredoverflow No.
 
And doesn't make any sense.
 
@ThePhD It does, most of the time.
 
9:37 AM
Is there something to install in sublime to get syntax highlighting?
 
@elyse Ah, hence std::make_pair.
 
Also is buying a license for the specific version?
@elyse
 
@JohanLarsson You have to save the file as "foobar.cpp"
 
gonna be some harassment today, sry my friend
 
Without the extension, sublime text doesn't know what programming language you love.
 
9:39 AM
@fredoverflow .rs testing rust
 
ah ok
Dunno if sublime supports Rust out of the box.
 
I could try to install 3.0
Should buy a license but it will probably be 5.0 the next time I use it so must know that upgrades are included :)
 
user1804599
@JohanLarsson I don't buy ST2.
 
user1804599
$$buffer = substr($self->recv_buf, 0, $length);
substr($self->recv_buf, 0, $length) = '';
 
user1804599
9:50 AM
substr returning an lvalue is great.
 
user1804599
@JohanLarsson don't buy a license.
 
user1804599
It's a waste of money.
 
@elyse Can you list all languages that have the concept of "lvalues"?
 
user1804599
Maybe.
 
user1804599
C, C++, Perl, Rust, and supersets of those. If that's all of them, then yes. Otherwise, no.
 
10:01 AM
@elyse What editor do you use at work?
 
user1804599
Vim.
 
Also what is SUblime written in? Java?
 
user1804599
C++ and Python.
 
Is there a way to have sublime syntax highlight rust?
 
no
 
user1804599
10:03 AM
Install packagecontrol.io, then control+shift+P, I, N, S, T, A, L, L, return, R, U, S, T, return, control+shift+P, R, U, S, T, return.
 
ty sir | milady
 
oh, sry was out walking the dogs
 
Is that a euphemism?
 
Yeah, I'm dumb, it was right there :)
 
10:09 AM
@fredoverflow no! woof woof
 
yay, it worked
typing in the console makes me nervous
maybe I'll try to setup build while im at it
ah, it installed with the package, nice
 
I haven't provided any code because I wasn't asking for coding help; just asking if I'm on the right track. I haven't got any globals, only a class in the other object file. If the class isn't actually used anywhere, can it still be the cause of the segfault? (I can't see how that's possible) — NeomerArcana 2 mins ago
once again someone assumes that stackoverflow is a place full of mindreaders
 
not sure what run does
no visible result
 
user1804599
@FilipRoséen-refp downvote, closevote, don't answer, problem solved.
 
-2
A: Can another object file being linked cause a segfault, even if it's not used in the code?

Filip Roséen - refpYes, linking with an object file can cause the application to crash It certainly is possible for a segmentation fault to occur by just linking the binary with some "unused" object file. The reason for your particular crash will remain unknown since you have not supplied any code that will make i...

given the question, why is this worthy of downvotes?
I just don't get this.. sunday madness
 
10:23 AM
actually I ended up downvoting it (changed my opinion from upvote)
the question is unanswerable and bad and wrong; answering it is just encouraging bad questions and vampires.
just vote to close and move on.
 
@Puppy you know you can go from upvote to "non-vote" by just clicking the upvote thing one more time?
 
er, yes.
I can do that but why would I?
your answer was not helpful (by definition since it's not really possible to help the questioner because he's a fucking moron, but that's another matter)
 
@Puppy of course you wouldn't, you are @DeadMG.
 
well technically I'm @Puppy
 
@Puppy it answers the question stated; "Is is possible that code within this other object file is causing a segfault?"
@Puppy for us who have been here long enough you will always be DeadMG
 
user1804599
10:26 AM
I downvoted because "Apparently a poorly worded question is enough for downvotes on answers that tries to answer it.. I'm baffled." is off-topic (belongs on Meta Stack Overflow), but you can't downvote comments.
 
user1804599
j/k :P
 
@FilipRoséen-refp That "question" is clearly answered by the circumstances of the questioner and merits no independent answers.
 
user1804599
lol Perl manual
 
user1804599
> *dick = *richard;
 
11:02 AM
What is * is Perl?
 
user1804599
The sigil for a typeglob.
 
Also interesting to note is how INT_MIN is defined on this particular system. They can't define it as -2147483648, because that would mean "negative 2147483648", and 2147483648 overflows an int! — Alok Singhal Feb 16 '10 at 19:09
hm, interesting
 
user1804599
@fredoverflow nice
 
What problem does name mangling solve?
 
user1804599
@JohanLarsson imagine an overloaded function
 
user1804599
11:11 AM
void f(int a) { }
void f(double a) { }
 
user1804599
If there were no name mangling, these would both have to be in the object file under the same symbol f. That's not possible.
 
Hey guys, I'm doing a program with Cpp-Netlib in Visual Studio 2015 and when i compile the project, i get just TWO link error in the library itself because it can't find the definition of some prototypes. What should i do now ?
 
user1804599
namespace a { void f(int a) { } }
namespace b { void f(int a) { } }
 
user1804599
This is similar.
 
user1804599
And also:
 
11:13 AM
ok
 
user1804599
class a { void f(int a) { } }
class b { void f(int a) { } }
 
user1804599
Applies to Rust as well.
 
I don't feel like writing any more rust today
 
fuck me, trying to get travis builds working takes more effort than it should, I now have to sort out updating the damn version of cmake
 
Should i get another compiler or i can fix those errors ?
 
11:20 AM
@Michele dunno - maybe if you asked a question on SO you'd find out?
 
@sehe what it was about recent mass shootings in US? Did Obama say something about civilians killed by US army in other countries?
 
@JohanLarsson so find just converts T to Option<T> ?
 
user1804599
*(**rc).borrow() ugly
 
no idea, oh I want filter, megaderp
 
user1804599
11:33 AM
@JohanLarsson is.gd/MoTwdW
 
user1804599
@JohanLarsson yeah :P
 
makes sense now
gonna time it next
think I need a crate
 
> The problem with defending the purity of the English language is that English is about as pure as a cribhouse whore. We don't just borrow words; on occasion, English has pursued other languages down alleyways to beat them unconscious and riffle their pockets for new vocabulary.
 
first would be a better name imo.
 
@ThePhD haha you're fucked
@AlexM. and what would you need an answer for? Every person has a different way of thinking. How much time did you spend learning programming before making anything useful?
2 years? 3?
people think they can program computers when starting learning haskell and that somehow should give them any head start
anyway lounge is pretty boring lately
 
11:43 AM
@AlexM. infinity because Haskell is literally useless (no mutable state) /badjoke
@BartekBanachewicz gotta invite more trolls
 
wanking over proposals for C++ which are supposed to fix the language and opinions about haskell from people who stopped at fibonacci sequence
and the only project that gets developed is a "gaem" built with awk and sed /badjoke @AnalPhabet
the athmosphere here is denser than in a fucking post-nuclear bunker
 
@BartekBanachewicz There's literally 1 invocation of sed in that thing now
And no AWK
 
@BartekBanachewicz just looking at this page makes you want to stop writing haskell.
 
And that one sed is to add a / after one XHTML tag
@Abyx I can loosely understand that up to 2.1.1, then I start choking on too many weird funcitons and syntax constructs
 
Gosh, now Bartek is mad that people are discusssing C++ proposals in the Lounge<C++>
 
11:53 AM
Isn't this room Lounge<C+plus>?
 
Ell
@BartekBanachewicz then make it less boring
 
@Abyx no, it makes you want to stop writing Haskell
@Ell trying eh
 
@BartekBanachewicz I didn't event start writing it
 
@AnalPhabet IRTA "I can understand up to 2.1.1 and then I can't understand anymore but of course I won't say that, instead I'll blame the <<weird>> language"
@R.MartinhoFernandes sue me
 
11:58 AM
@BartekBanachewicz v0v, and I'm not blaming the language
 
you are, you just don't think you do
I'm so annoyed with people justifying their shortcomings with external factors
 

« first day (1814 days earlier)      last day (3134 days later) »