Advanced C 28: Generics

preview_player
Показать описание
Make generics in C using the C11 standard _Generic keyword.

Social links:
Рекомендации по теме
Комментарии
Автор

This might be the thickest French accent I've ever heard, I love it!

aarorissanen
Автор

These are some very nice features that are not talked about a whole lot, thanks for bringing it to light!

SeanCodingThings
Автор

This looks much more like an overloading rather than generics. Still I was not aware about the _Generic keyword in C, thank you.
BTW: "C #" looks very misleading, the title looks like the video is about C#, but the thumbnail shows the logo of C...

butjok
Автор

Each time I learn new things thanks to your videos however I am C user for many years already. !!

marekdorobczynski
Автор

Nice!!
I have a video suggestion: Writing C wrapper for C++ methods.
Or calling C++ methods/functions in C.

woddenhorse
Автор

This feels like its the wrong solution for what generics solve because you still need to write every function. The great thing about c++ templates is that you only need to write the function or class once to use the template with any type. In this case, you still need to write every function so why not just call the function directly?

CoderKrill
Автор

Did you study Computer Science in college or are you self taught?
Nice content by the way, very interesting!

pac
Автор

Pretty cool. However, definitely something a library can overuse. It ought to be obvious what function is called and what is the return type of the function, and generics can muddy that if the ”convinience” of writing code is overvalued.

For example, someone might use generics to allow pass-by-reference, which returns the same pointer, while doing whatever to the underlying data. The compiler should scream at you about wrong type of argument if you intended to get a value back, not a pointer. But who knows where this unintented pointer might end up causing havoc.

catcatcatcatcatcatcatcatcatca
Автор

I'll use void* thank you very much

CoolestPossibleName
Автор

Why I would use this instead of something like this:

```
#define add(a, b) (a) + (b)
```

Genuine question, great video tho!

zaitsev
Автор

Nice video but this is function overloading not generics

johanavril
Автор

the title is Advanced C # 28
I thought this is a C# tutorial lmao

lordadamson
Автор

So just operator overloading in C++?

This is actually very cool.

idkwho-jhtq