« first day (1844 days earlier)      last day (3109 days later) » 

3:00 PM
@AlexM. lol
 
@AlexM. That's prolly it then
 
@AnalPhabet They're talking shit, better come in here to defend yourself.
 
@AlexM. #premium
 
1
A: How to implement a SQL like container in C++

seheI'd use Boost MultiIndex containers. Let me draw up a sample: Live On Coliru #include <boost/multi_index_container.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/random_access_...

BMI is nice after all
 
Ven
@Elyse with your gist, you need an explicit (do for the body
 
user1804599
@Ven Why?
 
@sehe Better? pastebin.com/CsS6MB7b
my
 
user1804599
@Ven What is do?
 
user1804599
3:16 PM
The language is pure.
 
Ven
@Elyse because id is (fn x x)
ok, so everything after "fn" is parameters except for the last expression?
 
user1804599
Yes.
 
user1804599
Yes. :p
 
Ven
ok. only works because it's pure :P
 
user1804599
And (fn x y (+ x y)) is equivalent to (fn x (fn y (+ x y))).
 
3:17 PM
@ElimGarak are you not annoyed by fallout 4's graphics
 
That's awful
 
there's this annoying white tint to everything
 
Ven
@Elyse kurri
 
I want to say something other than annoying but I can't find the word
 
user1804599
@Jefffrey Why?
 
3:18 PM
sometimes there are things that look out of place, like this looks like it was taken from borderlands somehow i.imgur.com/Vqmpf9O.jpg
 
user1804599
Currying is nice.
 
(fn x body) is hard to read
 
Ven
@Jefffrey thinks @Elyse care. cute :P
 
It's hard to distinguish between what's the body and what are the parameters. Especially with pattern matching and non-trivial bodies.
 
user1804599
Then write (fn x, body) or (fn x => body).
 
user1804599
3:19 PM
, and => are treated as whitespace.
 
Are you writing a lisp dialect?
 
@AlexM. It's basically Bethesda devs doing irresponsible, but necessary work (to survive) on top of Gamebryo which is not that different from FO3/FNV/Skyrim, mostly differences in shaders. The geometric limit is still evidently terribly low. That screenshot that you provide, I could probably trace the triangles comprising it in 5 minutes.
 
user1804599
@Jefffrey No.
 
Ven
pretty much.
 
Even the configuration tool is the modified Gamebryo one, with a few more widgets.
 
user1804599
3:21 PM
I want a statically typed purely functional programming language with an implementation that isn't two million terabytes in size.
 
user1804599
For things like build scripts.
 
So a kworker thread is taking 100 CPU constantly
 
128k lines of warnings with MSVC for a project that compiled without a warning with MinGW.
 
BREAKING NEWS: Elyse wants a programming language.
 
Half of it is just performing gf100_vm_flush via ioread32 all the time
 
Ven
3:22 PM
@Elyse add cabal
@fredoverflow mh, I don't believe it
 
user1804599
@Ven ?
 
Ven
@Elyse cabal is amazing
 
Here is the Fallout 3 configuration, they just redistributed everything. Cut down on the tabs. So expect fabulous animations for running.
 
Ven
you need it
 
user1804599
what for?
 
user1804599
3:23 PM
I'm going to implement it in C++ and Lua.
 
Ven
for the "hell" part
 
user1804599
?????????????????????????????
 
Ven
@Elyse I'm hinting at the fact cabal is broken. whatever
 
@ElimGarak so it's the same engine I get it now
I thought it was sth new
 
user1804599
Lua has TCO which makes it a nice fit.
 
3:26 PM
@Elyse Today I was informed via email that I absolutely must use Visual Studio in my C course :(
 
Ven
mmh. if I have a function that returns a std::unique_ptr<T> foo();, is std::unordered_map<int, T> map; map[3] = std::move(foo()); the optimal way to get it in my map?
 
No need to std::move, because foo() is already an rvalue.
 
user1804599
@fredoverflow use skorbut
 
You may want to read up on std::map::emplace.
 
user1804599
In law, an appeal is the process in which cases are reviewed, where parties request a formal change to an official decision. Appeals function both as a process for error correction as well as a process of clarifying and interpreting law. Although appellate courts have existed for thousands of years, common law countries did not incorporate an affirmative right to appeal into their jurisprudence until the nineteenth century. == History == Appellate courts and other systems of error correction have existed for millennia. During the first dynasty of Babylon, Hammurabi and his governors served as the...
 
Ven
3:28 PM
@fredoverflow .emplace({3, foo()})?
@fredoverflow I read about it, but it seemed like it'd do a copy, which I'd like to avoid
well, you're right that [] is wasteful. I'll use emplace. EDIT: heh, I actually had insert in my code
 
user1804599
@fredoverflow wait, you must use VS?
 
user1804599
just start VS, then quit it (now you've used it), then use skorbut for the rest of the course
 
Ven
I don't get the difference between map#insert and map#emplace.I'll need to read more.
 
skorbut does not sound very expensive
 
10
Q: How to emplace object with no-argument constructor into std::map?

InkaneI want to emplace an object into a std::map whose constructor does not take any arguments. However, std::map::emplace seems to require at least one additional argument besides the key. So how can I forward zero arguments to the constructor?

 
3:33 PM
After spending a few weeks with MSL, HLSL is really shit.
 
what does msl look like?
 
user1804599
@Ven insert takes object, emplace takes ctor arguments
 
Ven
@fredoverflow well, it's not a 0-ary ctor. I get a std::unique_ptr<T>, but I just want to store a T
 
@fredoverflow teach them rust instead
 
@JohanLarsson It is a reasonable subset of C++11 with a special stdlib. :D
 
Ven
3:35 PM
@Elyse right, but I have a std::unique_ptr<T> (temporary returned by foo())
 
user1804599
meh, exposed unique_ptrs
 
Then you have to use *foo().release() or something.
 
ugh
 
@ElimGarak Are you writing 2d or 3d stuff mostly?
 
@Ramy dunno. The formatting certainly isn't. Also, abusing stdafx out-of-tree. Ugh. And OS-specific synch. Reserved identifiers. C-style structs. Mixing tabs and spaces. DWORD. Fucking m_sem not even used. Copying full async resultset into a container eagerly? Oh. And using mySql
Storing SQLResult* in a vector, not honouring Rule Of Three. The fucking type not even polymorphic, so use vector, or stable_vector if you must. Not typedeffing the container or using auto for the iterators. Using strange names for iterators (past?). Nohting ever initializes m_pkSQL. So that's encapsulation disavowed then.
What happened to smart pointers... uiResultsPos in the database layer?!?!##!@# Not using prepared statements and bound arguments. C-style error handling through multiple non-encapsulated field. Read: missing errorhandling. CAsyncSQL2 - naming fail.
CAsyncSQL looks somewhat saner. Possibly because it was nicked from somewhere?
 
3:36 PM
@JohanLarsson 3D, but also have to maintain the 2D GUI toolbox running on top of D3D, behind all the editors.
 
Ven
@Elyse I don't see how I could do that otherwise. It's a non-copyable type, and since it's a subclass, I can't just walk around with a T. I need a T&. but I can't return a T&, since the returned value is local to foo()
 
user1804599
@sehe Java-style volatile
 
@Ramy Is that why github.com/enhanceMT/Server shows a DMCA takedown notice?
 
user1804599
@Ven Don't expose polymorphic classes. They cause too much trouble in APIs. channel9.msdn.com/Events/GoingNative/2013/…
 
user1804599
Except exceptions.
 
Ven
3:38 PM
@Elyse ok, well, please rewrite all these classes for me, ty.
I'm not rewriting $work's codebase
 
user1804599
No, do it yourself.
 
Ven
I said I won't.
 
@Nooble so I'm now verified on Dreamspark but the GH dev pack link just takes me back to GitHub's own portal
 
@Ramy oh, I almost forget: paste.ubuntu.com/13092252 - I've not added proper copyright attribution. I might have removed a field too soon, because I realized late that public member access was the norm
@Elyse Ew. I stopped looking at the types missing implementation
 
Ven
@fredoverflow mmmh. not sure how I got myself into such a situation anyway haha. I guess I'll need to store the unique_ptr, because I can't store a T, I need a T& to avoid object slicing... ugh
guess I need to store the unique_ptr :[
 
3:42 PM
There's nothing wrong with storing unique_ptrs in a map.
 
@Ven boost::ptr_map, profit, or indeed multi_index_container<T*,...>
 
Mm
Using Boost.Range ADL doesn't work :c
Is this normal?
 
@Jefffrey No. It's also not true
 
@JonClements How about Mark Boulder or Anna Lahar :geological jokes:
 
Ven
@sehe ...why's that better?
 
3:44 PM
Easier. Potentially better. Depends on usage
 
Ven
also why multi_index? I don't need multi indices
 
Just use a map of unique pointers. Fuck Boost.
 
Am I imposing? I feel a lot of defense
 
@GregorMcGregor Bit naff really? :p
 
Ven
damn
 
3:44 PM
@sehe I've imported <boost/range/irange.hpp> and it couldn't find begin for a boost::irange.
Am I missing some import?
 
@Jefffrey Have you tried compiling clang from source?
 
@Jefffrey Should work. SSCCE?
 
@JonClements Of course it's not that you silly, I never give my future nicknames away! That ruins the fun
 
Ven
@sehe well, I'm just not sure what boost's ptr_map is buying me here over map<K, unique_ptr<V>>
 
@fredoverflow Andrei!
@Ven Convenience of not dealing with move-only semantics in some spots. So, less .get() at the least
 
@Jefffrey range too large, OT
 
Ven
@sehe it's an inner, never-exposed map. Erm, I probably don't know enough to understand what you mean WRT "not dealing with move-only semantics"
 
Thank you! the order actually meant nothing to me until now. — Jose L. Rico 3 hours ago
How can people use Qt but not know that a = b is not the same as b = a?
 
@fredoverflow it was
at least to me
 
Ven
I know so little I don't even know if std::unique_ptr<T&> has any use
 
3:47 PM
esp the part about monoids
 
@fredoverflow managers
 
Ven
@AlexM. monoids in the category of endofunctors are monads.
 
gonad tutorial
 
@sehe Uh?
@ChristianHackl Why would I prefer it to boost::find_if? — Jefffrey 4 mins ago
@Jeffrey: Because it's standard and boost::find_if is not. — Christian Hackl 3 mins ago
 
@Jefffrey coliru.stacked-crooked.com/a/40f4f3bda9437186 Sadly, irange is not from boost then
 
3:49 PM
:c
 
Ven
@milleniumbug egads, it's so sad
 
@Jefffrey It's the weather today
Infidels
 
Her hubby must be a programmer...
 
@sehe Wait. How can it be? I'm qualifying it as boost::irange, no?
Oh
 
user1804599
@Ven I can't wait to implement Algorithm W in Lua.
 
3:51 PM
Maybe it's a function which is returning something that's not from the boost namespace
 
user1804599
It will be so much fun. :D
 
Ven
@Elyse I can't wait to understand the questions I asked :P.
 
@Jefffrey the type
 
@fredoverflow should've placed half that quantity and left the rest for the next sprint
2effort
 
template<typename Integer>
integer_range<Integer>
irange(Integer first, Integer last)
{
    BOOST_ASSERT( first <= last );
    return integer_range<Integer>(first, last);
}
Hmm
@sehe The type is boost::integer_range<int> apparently
 
user1804599
3:52 PM
Maybe I should change signature to declare.
 
user1804599
(declare pair (for-all a b (fn a b {a b})))
(define pair (fn x y {x y}))
 
@Jefffrey then... There needs to be a symbol named end in view. Otherwise ADL doesn't even kick in.
 
user1804599
Hmm, or remove declare completely and require the type in define.
 
@sehe But there is, otherwise using boost::end; in your example would trigger an error, no?
 
Ven
@Elyse is there any reason you'd store a T& in a unique_ptr?
 
user1804599
3:54 PM
You can't.
 
Ven
great
 
user1804599
It'd result in T&*.
 
lol that Stack Status tweet got 39 retweets
 
user1804599
Well, you can if you define pointer in your deleter.
 
Is T&* even legal
 
Ven
3:56 PM
right. and I should only pass unique_ptr by value. const ref should use T*, and nonconst ref should just accept T&
 
@Jefffrey gosh. That's exactly what brings it into view. Note that using std::end; works just as well
 
Ell
I'm making lemon curd
 
@sehe 0.0
Am I being thick?
 
@Ell Just a single curd?
 
@Jefffrey nope
 
3:56 PM
@Jefffrey I was on the wrong track earlier, but "need in view" not very unambiguous
 
But if you import it, then it means that end is a valid identifier, and that's the one that is used. That's not what I know ADL to be.
 
@fredoverflow or an asshat :P
 
AFAIK ADL should automatically select boost::end when used with an object of type in the namespace boost.
Which is what I was trying to trigger there
 
Shame there is no range any_of. coliru.stacked-crooked.com/a/4d3f6245db5ff227 would be the best
 
Ell
One jar of :3
 
3:58 PM
@Jefffrey It should not.
10
Q: what does `using std::swap` inside the body of a class method implementation mean?

Stephane RollandI was doing some c++ practicing this afternoon, and was trying to learn and adopt the copy-swap idiom following this thoroughfully explanation on this question: the Copy-Swap Idiom. But I found some code I had never seen: using std::swap; // allow ADL in this example class dumb_array { public: ...

83
A: How to overload std::swap()

Dave AbrahamsThe right way to overload swap is to write it in the same namespace as what you're swapping, so that it can be found via argument-dependent lookup (ADL). One particularly easy thing to do is: class X { // ... friend void swap(X& a, X& b) { using std::swap; // bring in swap f...

 
Calm down, wait
I know that you have to import it when defining certain functions, otherwise ADL not always selects the right now.
 
I'm calm. And those are helpful links, because I'm not interested in convincing you on faq answers :)
 
That's not what I'm talking about
 
It's the same here.
@Jefffrey "otherwise ADL not always selects the right now" is bogus
> otherwise ADL doesn't know to start looking for better overloads in associated namespaces
FTFY
@Jefffrey So, instead of rejecting and "Wait!" - read them again. Yes it's tricky. I was side-tracked as well for a minute or 2
 
user1804599
(deffn f
  (() () 0)
  ((x . xs) (y . ys) (+ x y (f xs ys))))
 
user1804599
4:01 PM
@Ven pattern matching.
 
I'm talking about this.
Isn't this ADL at work?
And it selects std::begin and std::end because unqualified begin and end are applied to an object of type in the namespace std.
 
Ven
yeah
 
@Jefffrey now I'm stumped. I;'ll be off for a while. Be back later to read up
 
user1804599
Hmm, (def d x ...) => (define x (d ...)).
 
brb, full of shit
 
user1804599
4:04 PM
Nah, terrible.
 
Ven
@Jefffrey seems like pretty standard ADL. what's baffling?
 
@Ven What's baffling is why this doesn't work instead
 
@sehe Ugly coding style, eh ?
 
user1804599
@Jefffrey There is no boost::end.
 
@Ramy It's more the other problems. I don't consider them style. I consider them design or smells
 
4:05 PM
@Elyse But there is.
 
user1804599
You have to include it, I mean.
 
@Elyse he has. Mmm. Mebbe. Nah. tried it
 
user1804599
Oh, weird.
 
@sehe I will try to rewrite source again.
 
Ven
@Jefffrey note that std::end and boost::end would both be candidates. Thus, ADL can't be performed
 
4:06 PM
@Ramy Don't do it for me :S
 
Ven
er, I'm full of shit. it's in the boost namespaces, which shouldn't use namespace std
 
user1804599
λ :set -XFlexibleContexts
λ 1 :: Num Int => Int
1
λ :t 1 :: Num Int => Int
1 :: Num Int => Int :: Int
 
user1804599
lol nice
 
Nooo :) Not for you, just for me.
 
@Ven huh? It would potentially be ambiguous, but in this case one would be the better match
 
Ven
4:07 PM
@sehe yeah, but that's all I could think of there.
 
@ElimGarak thoughts? maximumpc.com/…
 
user1804599
@fredoverflow Except in Haskell, which has 30-bit integers.
 
what are the last two bits used for?
 
@Ven Why is std::end a candidate?
 
Ven
@Jefffrey see 2 lines below
 
user1804599
4:10 PM
Wait, no need for deffn. def suffices.
 
0
Q: Why is ADL not working here?

JefffreyConsidering: #include <cassert> #include <boost/range/irange.hpp> #include <boost/range/algorithm.hpp> int main() { auto range = boost::irange(1, 4); assert(boost::find(range, 4) == end(range)); } Live demo this gives: main.cpp:8:37: error: use of undeclared identifier 'end' Wh...

Free rep if you know the answer
 
Ven
what's the file with boost::end in boost anyway? doesn't it have an ADL barrier?
 
@sehe I really want a man like you in my team :D
 
@ScarletAmaranth Any upgrades of the user GPU control software are very much welcome, but hopefully they won't expose too much in there. Usually gamers do themselves a disservice when they tinker way too much in there. :D I like the reduced start up time, I remember being quite annoyed with CCC during my tenure with the HD6990s.
 
Ven
 
4:11 PM
@Ramy You can pitch it to me. But be serious. From the way it started I'm really happy to not burn my fingers.
 
@Ven Post it as an answer :)
 
Ven
@sehe ^ does that make sense?
 
@Ven Not that I know of. That ADL barrier is for library-internal use, so they don't get hurt by conflicting things from userdefined types (think boost::integer_range<MyIntegralType>....)
 
Ven
well, looking for something else then.
 
But, I'm still confused. I'll read those answers I linked previously myself, later
 
Ven
4:13 PM
about swap?
 
@Ven Wait, then it would complain with using boost::end too.
 
user1804599
defalgebraicdatatype
 
Right?
 
Ven
@Jefffrey no, you explicitly qualified that one. ADL is not performed
ADL is only performed on unqualified names
 
std::operator<<(std::cout, 42)
 
4:14 PM
@Ven Yes, but if the only one available was boost::range_adl_barrier::end, then using boost::end; would not compile.
 
@Jefffrey I thought there is.
 
So other than boost::range_adl_barrier::end, there must be at least boost::end available.
 
Ven
using boost::end; is enough to make your code compile: coliru.stacked-crooked.com/a/fcfc3c865852af02
@Jefffrey of course
 
@Ven We established that 30 minutes ago
 
Ven
@sehe then I still blame, somehow, range_adl_barrier, until I can find more about it and understand exactly where it's pulled in boost
 
4:17 PM
30 minutes of ADL.
 
Ven
@sehe reading svn.boost.org/trac/boost/ticket/1697, it does seem to me ADL is blocked for end..
boost::end is then pulled, at the end, with a namespace boost { using namespace range_adl_barrier; }.
 
@Morwenn that's when you try to compile spirit v2
 
Ven
and, from the ADL rules: "using-directives in the associated namespaces are ignored."
@Jefffrey I'm going to post this as an answer.
 
Ok
 
user1804599
aahhhh I have a problem. :(
 
4:21 PM
@Elyse You need a programming language?
 
I have to go
BBL
 
@Jefffrey they explained the rationale behind the adl barrier on the mailing list
 
Ven
@sehe er, do you have a standard draft handy?
 
user1804599
(defdata List a ;; ambiguous
  Nil (List a)
  Cons (fn a (List a) (List a)))

(defdata List (a) ;; ugly; inconsistent with forall and fn
  Nil (List a)
  Cons (fn a (List a) (List a)))
 
> Nil
Cons
Both
 
Ven
4:22 PM
0
A: Why is ADL not working with Boost.Range?

VenThat's because boost::end is inside an ADL barrier, which is then pulled in boost at the end of the file. However, from cppreference's page on ADL (sorry, I don't have a c++ draft handy): 1) using-directives in the associated namespaces are ignored That prevents it from being included in A...

there goes nothing :).
ah, someone answered a few seconds later... Heh. I'm bad at this SO thing.
 
user1804599
Maybe I won't go with S-expressions.
 
sex pressions
 
Ven
yeah, from the boost/range/begin comment, seems I was right when @sehe didn't want to believe me :(
 
4:34 PM
@Ven the comment kinda process you right. Had already up voted. Walking to school at the moment
 
Ven
@sehe oh, have fun then
 
@Ven oh. Why the sad face. It's unimportant whether I get it immediately. I was gonna read up. You beat me to it. Thanks
In still a bit baffled. But I guess having to absolutely indicate you want to consider boost free functions could be nice. And it's not to much of a burden
 
Ven
well, it'd probably be a tad too many functions running free
 
@Mr.kbok we dont have the same definition of better
 
Ven
(it's not a sad face, I'm actually really happy I found the solution)
 
4:38 PM
@Borgleader look at the second part :)
 
@Mr.kbok In fairness, he has since edited out the most egregiously inaccurate parts of that answer.
 
Ell
ah lord that's purty
 
@Mr.kbok Admittedly, what's left isn't great (or even good) but it's accurate to the degree that you could do something like that, and it would work (for a really loose definition of "work").
@Ell I hope you're talking about the code. I can't say I'm very impressed with the mountains.
 
Ell
Haha no, not the code
just the theme
 
@Ell There's a theme there?
 
4:46 PM
Yeah, he removed all the strongly, factually wrong statements. All that's left is what could be interpreted as "correct" from a semantic POV
 
Ell
@JerryCoffin Sure :P
the colour scheme
 
@Mr.kbok What's left is correct, but still clearly wrong.
@Ell Hmmm...what's it named? "MLP vomited on my screen?"
 
Time to go home
later boyz
 
Ell
Flat Yosemite or something
it's not vomit-like at all :P
 
@Rerito Later.
 
4:52 PM
@Rerito Later boi.
 
@Ell vomit
Unreadable vomit
Light grey on almost white? Seriously?
 
Xeo
Light grey on dark grey masterrace \o/
oops, let my German slip through
 
should be black against slightly darker black
 
Xeo
Taiga's on my chest getting pampered, again
 
And surrounded by fucking pink
 
Xeo
4:55 PM
and I was just about to get up and make something to eat...
 
@Mr.kbok what the bloody fuck
 
My eyes are dying
im dying
 
@Ell too much pastel, not dark enough
 
@CatPlusPlus Can I have your stuff?
 
And what is that, a font for ants?
 
Ell
4:56 PM
I need to sort my powerline out
 
going to see SPECTRE tonight
I'm looking forward to it
 
I'll save it for teh weekend <3
 
@Borgleader There's pastel goth for that.
 
@Ell meh it's unreadable
 
@TonyTheLion Enjoy.
 
Ell
4:59 PM
@Mr.kbok pshht you don't need to read stuff on it ;)
 

« first day (1844 days earlier)      last day (3109 days later) »