[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: IMG_5157.jpg (30 KB, 1400x700)
30 KB
30 KB JPG
Tell me why I should bother with C++ templates and all the idiotic garbage that comes with this feature (like having to do some voodoo magic to define them in a separate file) if picrel exists?
>muh type safety
Write better code.
>>
you'll know when you need it
>>
Why do you want to write code like a Pythonista?
>>
>>107273137
>.h files are *magic*
>how will you find biggest of integers T using void * you you retard, in void* biggest_value(void *range, size_t count)?
not to mention containers

what a dumb question
back to school Rajesh.
>>
>>107273237
>doesn’t even understand what I’m talking about
learn what source files are, rajput
>>
>>107273337
You are the one who said putting code in header files is "voodoo magic", Sunita
>>
>>107273431
Absolute retard.
>>
File: sigh.png (686 KB, 584x906)
686 KB
686 KB PNG
>>107273137
> I want to store an uint8_t inside my "generic" void* dynamic array
> allocate space for the uint8_t on the heap
> put a pointer to the uint8_t in the array, as void*

Total amount I needed to store: 1 byte
Total amount allocated: 9 bytes (1 pointer + 1 byte)
Overhead: 88%

> I need to retrieve the uint8_t at index 7
> Look at index 7
> My uint8_t is not there
> This is a void* pointer, wtf?
> follow the void* pointer into the heap
> I finally find my value
>>
>>107273456
>*seething while shitting his street*
wow great technical argument, Ram. I'm sure Google will hire you now.
>>
>>107273137
Type safety doesnt really matter if your whole project is less than 1000 lines of code.
>>
>>107273137
>Write better code.
Better code includes compile-time assertions about your code, e.g. type constraints.
>>
>>107273137
If you're not gonna use the type system you could well just use PHP like a normal retard
>>
>>107274273
wrong better code just goose fast and no bugs >>107274299 php s too slow
>>
>>107274384
Thanks for bringing down Cloudflare, I guess.
>>
>>107273137
Based OP. This kills the rustvestites.
>>
>>107273137
>>muh type safety
>Write better code.
you can only write better code in C++ with a proper type system, thougheverbeit.



[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.