« first day (1443 days earlier)      last day (3496 days later) » 

user3010322
11:00 PM
Because writing overloads for ints versus floats isn't a nice idea?
 
Is it cheating if I read over this : math.stackexchange.com/questions/389675/…
 
std::is_integral || std::is_floating_point?
 
Don't make it a universal reference. Problem solved.
 
hell, in that example, you don't even know that the hull is breached, you only know that there's a single drop of water on the floor.
 
11:03 PM
enable_if<is_same<>> is silly.
"Accept anything for this parameter, but only if it is of this one particular type"
 
user3010322
It was if !is_same<>
 
user3010322
But I've fixed it all anyhow.
 
you forgot ::type, btw.
 
user3010322
std::enable_if_t
 
user3010322
Self-debate between const TArith& and TArith
 
user3010322
11:08 PM
Most primitives should fit in a single register.
 
@Puppy That's somewhat true. However, you can still have canaries in the library code responding to the invariants of that library. It makes sense that the caller cannot be aware of them, and it's still helpful to be able to run in super-vigilant mode. It makes no sense to be forced to run in "let's sing a happy song" mode always
 
user3010322
But that q<256, 32> bit type tho....
 
user3010322
Ah well, too special case to matter.
 
I think I realised what you're doing.
 
user3010322
11:09 PM
TArith
 
Did you swap left and right on purpose?
 
user3010322
Huh?
 
user3010322
For, uh, things like operator* and operator+, I leave the order like that because I just call the other version in the other order.
 
@sehe I definitely don't agree with simply not checking. But if it results in a failure, then only the caller knows whether or not that's a process-termination error (unless it's a guaranteed process termination, like, say, memory corruption). There's plenty of situations where you want to perform your own error handling, even if that requires terminating that specific library instance, it might still not entail terminating the whole process.
 
user3010322
The real implementation is in the left, right version
 
11:11 PM
Oh my.
 
user3010322
I don't do that for division or subtraction, though
 
@Puppy on the contrary, if a library-internal invariant is broken, the caller shall not possibly know anything about that. At all.
 
Someone will have fun when they do matrix multiplication by vectors.
 
@Puppy Asserts are not for error handling
 
that's exactly what Niebler used them for in his article.
 
11:12 PM
@ThePhD way to assume commutativity?
 
Kill it before it spreads.
 
user3010322
There's seperately defined operators for Matrices and vectors...
 
user3010322
Eventually I'm going to fold everything into a Matrix<n, m, T> class, but not right now..
 
@Puppy ?! really. I don't think it's "error handling" if you have a domain error on function input.
 
it absolutely is.
 
11:13 PM
Oh well. You must be right.
 
user3010322
Argh, damnit.
 
the appropriate response needs to be determined by the caller
 
That's why UB doesn't exist. Only sloppy error handling.
 
user3010322
Not using a universal ref is apparently still a problem. ;~;
 
don't see what UB has to do with anything in this discussion
 
11:15 PM
Ugh.
Handling domain errors is just wrong.
 
o really
 
Fuck the caller.
 
user3010322
I dunno, some domain errors you can fix.
 
it must be plain wrong then for me to, I dunno, report the error in an application-specific way?
 
user3010322
Like not having write permissions, but you only need read permissions.
 
11:16 PM
If they are in any position to determine anything, they would not cause the error in the first place.
 
user3010322
Or when a certain hardware adapter isn't available, but the next one down is.
 
@ThePhD that's not a domain error.
 
that would just be duplicating the function's internal error detection.
 
@ThePhD not a domain error either.
 
user3010322
Oh. Well then, I have no idea what's going on. :D
 
11:17 PM
@R.MartinhoFernandes fuck it, im asking, whats a domain error
 
the caller should be given the opportunity to handle any detectable error where the process state is not already irrevocably fucked.
 
@Borgleader mathematical errors maybe?
 
user3010322
Aww
 
user3010322
std::is_arithmetic_v is not a thing yet.
 
lazy ass
just type ::value
fuck the _v traits
 
user3010322
11:19 PM
:effort:
 
Or, maybe, add {}.
 
user3010322
Vector<float, 3> v{ 0, 0, 0};
v += 1; // component-wise addition, EXPLODES WITH ERRORS
 
user3010322
q_q templates make me sad sometimes
 
Ugh.
You're horrible.
 
user3010322
How is that horrible.
 
user3010322
11:21 PM
That's a common operation!
 
To start with, that's not component-wise addition
 
user3010322
It totally is.
 
Totally not.
 
user3010322
It adds one to every component! :c
 
no.
 
user3010322
11:22 PM
It's not LITERALLY component-wise addition but like
 
user3010322
Scalar multiplication behaves the same way with a vector/matrix. :c
 
user3010322
Scalar addition should be a thing too!
 
yes, but multiplication and addition are TOTALLY DIFFERENT THINGS.
component-wise addition is a useless meaningless idea.
 
user3010322
Size<int, 2> woof{ 20, 20 };
woof -= 10;
 
user3010322
Looks USEFUL TO ME.
 
11:25 PM
you just called the function, that's not a use case
 
user3010322
I'm using it right now for my hex grid stuff. ._.
 
user3010322
 std::transform( woof.begin(), woof.end(), woof.begin(),
 []( auto&& w ) { return w - 10; } );
 
user3010322
Is not my idea of a good time.
 
lol
const int&
 
user3010322
Whatever, it's an example. u.u;
 
11:26 PM
-> int
0/10 example
 
user3010322
SIIGH.
 
{ return w - 10 )
 
@ThePhD You just compared an operation on a single variable to operating on multiple
0/10
 
@ThePhD :p
 
user3010322
There.
 
user3010322
11:27 PM
@Borgleader It's woof for both the input and the output. ._.
 
I don't see how component wise addition is terrible.
 
ones a single woof, the other is multiple woofs
of course it takes more code D:
 
I'll take your side for this.
Component wise multiplication (i.e. scalar multiplication) set a precedent here.
 
user3010322
Question, though.
 
?
 
user3010322
11:30 PM
Size<int, 2> w{ 20, 20 };
auto b = 10 - w; // { -10, -10 } <--- useful, alongside the other version?
 
Not sure.
 
Componentwise multiplication is not scalar multiplication.
 
@ThePhD that makes no sense to me, id just w * -0.5 in this case, or something
 
Just like this is not componentwise addition.
 
user3010322
;~;
 
11:32 PM
@R.MartinhoFernandes What are you defining as element wise multiplication?
How is 10 * { 5, 5 } = { 10 * 5, 10 * 5 } not 'element wise multiplication'?
Do you consider 'element wise multiplication' to just be a hadamard product?
 
{ 5, 5 } * 10 != { 5, 5 } * { 6, 6 } (the former is scaler, the latter is element wise AFAIK)
 
@Borgleader er.. what?
multiplication between two vectors isn't defined through operator*
it can either be hadamard product, cross product, or dot product
it's ambiguous
 
@Rapptz yes.
 
scalar multiplication isn't
 
@Rapptz that wasnt an operator * overload, i was explaining the difference between the two since you were asking about the difference
 
11:35 PM
it doesn't explain the difference because it's ambiguous
 
Yeah, that explanation makes no sense without knowing what the right hand side of != means.
 
user3010322
So, std::enable_if_t doesn't work in MSVC
 
o.o what? one is a vector multiplied by a scalar the other is a vector multiplied by another vector... and you can probably infer that i didnt mean dot product since i said element wise multiplication in there
 
user3010322
I have to use...
 
user3010322
typename std::enable_if<std::is_arithmetic<TArith>::value, RVector<T, n>>::type
 
11:37 PM
Hey, bitches.
 
user3010322
;~; my _t type traits, dashed on the rocks!
 
it shouldn't be hard to define your own type alias
 
@Borgleader yes, you said it's elementwise. But you didn't say what that means.
 
user3010322
@AndyProwl But do I waaaant to define my own? :c
 
@ThePhD I don't know, you looked sad :)
 
11:38 PM
lol you're doing this on MSVC?
 
user3010322
I do have tmp_type
 
{ 5, 5 } * 10 -> { 50, 50 } vs { 5, 5 } * { 6, 6 } -> { 30, 30 }
there
 
the ::value is another reason why MSVC sucks
 
user3010322
11:38 PM
template <typename T>
using tmp_type = typename T::type;
 
user3010322
@AndyProwl Yeah, implicit constexpr conversions to the ::value in GCC rocked my socks.
 
@R.MartinhoFernandes hey i only have 132 errors compiling ogonek with clang-cl and its mostly the same error repeated ad nauseum (sp?)
 
user3010322
ad-na
 
What is it?
 
user3010322
There's a dash there I think.
 
user3010322
11:39 PM
@R.MartinhoFernandes 20 bucks says char32_t
 
user3010322
MSVC defines these in some stupid header somewhere.
 
No dash. It's just two Latin words.
 
@ScottW i wasnt listing them all, just illustrating scalar multiplication vs element-wise
 
user3010322
Oh. Well TIL.
 
I still consider scalar product to be element wise.
You apply the scalar component and multiply it to every element.
 
user3010322
11:40 PM
Maybe I should just do type<> instead of tmp_type
 
user3010322
I don't think there's anything in the std:: called just type
 
user3010322
Yeah, I'm not finding anything...
 
@Borgleader {5, 5} * 6 == Times[{5, 5}, {6, 6}]
 
user3010322
type<> it is~
 
@ThePhD just put it in your own namespace
 
user3010322
11:41 PM
@AndyProwl I do, but I want to avoid nomenclature clashes whenever possible.
 
I see
 
@ThePhD There is that (you can "fix" it with the right header but it fucks up with the .g.inl files later), but the one i see the most is:
> static_assert(std::is_default_constructible<optional<int&>>(), "");
error: static_assert expressions is not an integral constant expression
 
user3010322
What?
 
user3010322
Clang should totally be able to decay that
 
struct none_t {
    template <typename T>
    constexpr operator optional<T>() const noexcept { return {}; }
} constexpr none;
> error : default initialization of an object of const type 'const struct none_t' without a user-provided default constructor
theres a few other errors but they dont show up nearly as many times as these two
 
user3010322
11:45 PM
That std::is_default_constructible one baffles me
 
user3010322
Clang should be able to handle that easily
 
user3010322
But I can try on clang
 
its possible its caused by shit they did for msvc compatibility
 
user3010322
> type_traits
 
like not recognizing char32_t as a keyword
 
11:46 PM
@Borgleader What's that syntax with the trailing constexpr none? I've never seen it
 
i had to:
#ifdef _MSC_VER
#include <yvals.h>
#endif
 
user3010322
Whoever fucking wrote that as the header name
 
user3010322
deserves to be shot
 
@Cicada ask robot :P
 
user3010322
Every single one uses typetraits
 
user3010322
11:46 PM
but nooo
 
user3010322
Someone has to go rogue and then NAH WE'LL PUBLISH IT.
 
user3010322
@Borgleader Definitely a compatibility issue: coliru.stacked-crooked.com/a/98c37ae3c78cbd8e
 
I SAID HEY, BITCHES
 
user3010322
@Cicada It declares a single instance of the class just defined.
 
@Cicada lern2c++
 
11:48 PM
@ThePhD Oh, yeah, obviously
 
struct none_t {
    template <typename T>
    constexpr operator optional<T>() const noexcept { return {}; }
};

constexpr none_t none;
 
@ScottW sup wxwidget
 
user3010322
It's used a lot in C code.
 
user3010322
Or, er, the typedef version is...
 
typedef struct { } struct typedef constexpr struct typedef T struct typedef T;
^ C
 
11:49 PM
@ScottW me neither ncurses. looking for a job
 
hey maybe you really did you all plonk me
wouldn't that be a turn for the books
 
or no bitches are present to answer your call D:
 
@ScottW I give up
 
MFC?
omg, my shoulderpads look dumb T_T
 
user3010322
Nah, man.
 
user3010322
11:53 PM
All shoulderpads look really boss.
 
im talking about a game here
if that was not obv
 
-1
A: C++ do/while loop and calling functions?

Ben VoigtJust get rid of if(choice == 'y') { void InputData(); // Input all data from user void OutputData(); // Output class list to console void ResetClasses(); // Reset class list } Because the variables are inside the do-while loop, they'll be recreated on each iterat...

Remarkable and uncharacteristic failure of logic from Ben, there.
 
im a warrior, whats with the beacon of light D:
 
user3010322
@Borgleader Hm... they're not too bad?
 
DO I LOOK LIKE A PALADIN? T_T
 
user3010322
11:56 PM
@Borgleader To lure your enemies into thinking you're a paladin, before you beat their faces in.
 
user3010322
It's the perfect tarp.
 
@ThePhD it looks worse in game because the glowing thing has a flicker effectand some stripes
World of Warcraft
 
Can you provide a link to some scientific paper that reveals magnetic properties now apply to non-metallic materials? It would be fairly groundbreaking and you could become quite famous! — Lightness Races in Orbit 16 secs ago
heehee
 

« first day (1443 days earlier)      last day (3496 days later) »