[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: bjarne-bldl-opening.jpg (390 KB, 897x429)
390 KB
390 KB JPG
>sfinae
What was his endgame?
>>
>>106981872
>endgame
to sell his 1000+ page textbooks
>>
>>106981872
Sauce? Can't say I recall seeing Bjarne in a suit before.
>>
>>106981872
making a very sharp knife that 99% of people will cut themselves. pretty good for the remaining 1% though
>>
It wouldn't make sense for a template declaration to cause a compiler error when it's not the template you want to use, makes perfect sense. It was given a name because you can overfload this feature as a customization point is called meta programming
>>
>>106982649
Based. 99% of the "people" shouldn't swim in dangerous waters desu to be honest.
#include <iostream>

// This overload is added to the set of overloads if C is
// a class or reference-to-class type and F is a pointer to member function of C
template<class C, class F>
auto test(C c, F f) -> decltype((void)(c.*f)(), void())
{
std::cout << "(1) Class/class reference overload called\n";
}

// This overload is added to the set of overloads if C is a
// pointer-to-class type and F is a pointer to member function of C
template<class C, class F>
auto test(C c, F f) -> decltype((void)((c->*f)()), void())
{
std::cout << "(2) Pointer overload called\n";
}

// This overload is always in the set of overloads: ellipsis
// parameter has the lowest ranking for overload resolution
void test(...)
{
std::cout << "(3) Catch-all overload called\n";
}

int main()
{
struct X { void f() {} };
X x;
X& rx = x;
test(x, &X::f); // (1)
test(rx, &X::f); // (1), creates a copy of x
test(&x, &X::f); // (2)
test(42, 1337); // (3)
}
>>
>>106981872
He looks very nice :)

Substitution Failure Is Not An Error (SFINAE)
I think he means stuff like when a struct is null, that you should program it in a way that it won't crash the program, so the program may continue working.

His endgame would be just good programming design and versatility.
>>
>>106982734
The 1% use like 50% of the language which they very carefully selected so that they don't get hit by footguns. The thing about C++ is that it has so many features (and yet it's still missing stuff like reflection...) that it's inevitable that some of them will interact in a catastrophic way if you're not careful.
>>
I might not know what I'm talking about, but I do like C++
>>
>>106982787
I don't consider this fact different than any other form of engineering. A race mechanic properly chooses his tools and coordinates carefully with his team members during raceday to avoid "footguns". In the hands of skilled craftsmen, sharp tools can create beauty.

Troons are brats about such things because they just don't measure up. Simple as.
int f1(int);
int f2(float);

struct A
{
using fp1 = int(*)(int);
operator fp1() { return f1; } // conversion function to pointer to function
using fp2 = int(*)(float);
operator fp2() { return f2; } // conversion function to pointer to function
} a;

int i = a(1); // calls f1 via pointer returned from conversion function
>>
>>106982734
Which is better? static_if or if constexpr?
>>
>>106982734
Intentionally pouring poison into waters and telling people they are retarded for not wanting to swim in them is not very bright.
>>
>>106981872
He'sfinae spit some rhymes
>>
>>106982845
What problem does this sharp tool solve?
>>
>>106983022
static_if is simpler to use (and therefore likely "better", so-called). OTOH, if constexpr addresses the same need, and has the BIG advantage of being actual C++.

>>106983037
int i = a(1);

Being able to call this deterministically at compile time with no runtime overhead is both powerful, elegant, & flexible.
>>
>>106981872
C, but with classes, and he didn't want to maintain it all by himself.
>>
>>106982787
Never the same 50%
>>
>>106984256
>all problems in the entire world of technical complexity are exactly the same at all times.
Anon, I...
>>
>>106981872
did you learn the word "endgame" last week or something?
and what is its connection to this nocoder?
>>
>>106984055
Jesus Christ.
>>
>>106984551
Dunno man, he created Sepples and its insanity.
>>
>>106985079
Is Lord of all? True enough.

>>106985087
Certainly if his agenda was to spark "BDS" in troons, then he succeeded quite nicely by all appearances.
>>
>>106982734
this is so fucking retarded
who even writes stuff like that
show me a serious c++ project on github with that kind of bs



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.