Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Faggotry

Name: Anonymous 2014-05-28 5:44

Why do C++ faggots write
auto dist = [&](uint32_t col1, uint32_t col2) { return colorDist(col1, col2, cfg.luminanceWeight_); };
template <typename T> T min(T a, T b) {return a < b ? a : b;}

instead of
#define dist(col1, col2) colorDist(col1, col2, cfg.luminanceWeight_)
#define min(a,b) ((a) < (b) ? (a) : (b))


???

I find C++ especially verbose.

Name: Anonymous 2014-05-28 5:46

le compile time guarantees, have you heard of them, nasty bitfucker.

Name: Anonymous 2014-05-28 7:32

I think think template min is in a namespace while defined min is not. dist looks like lambda syntax. Do people actually use this now?

Name: Anonymous 2014-05-28 11:27

>>3
Yes, people use lambdas nowdays. We don't live in caves anymore.

Name: Anonymous 2014-05-28 11:47

>>4
C++'s lambdas are not real lambdas
you can use something like namespace in C too


#define namespaceName_dist(col1, col2) colorDist(col1, col2, cfg.luminanceWeight_)
#define namespaceName_min(a,b) ((a) < (b) ? (a) : (b))

Name: Anonymous 2014-05-28 15:19

>>5
Why aren't they real lambdas?

Name: Anonymous 2014-05-28 16:02

>>6
it's just a syntactic sugar for functors..

Name: Anonymous 2014-05-28 18:30

>>7
functors are category structure preserving maps. Anything else nonsensical you'd like to add?

Name: Anonymous 2014-05-28 18:35

>>8
functors are objects that implement the operator() method. do you even program?

Name: Anonymous 2014-05-28 18:39

>>3

Do people actually use this now?
I've seen a lot of C++11 features recently, because my old GCC doesn't want to compile them and I have to replace them with ({...}) in a macro (which for some reason always work)

Name: Anonymous 2016-07-11 5:29

(stopping the dubsfaggot from dubsbumping)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List