Skip to main content

Thread: Generics for C++ ?


in ada there things called generics, kinda classes guess, when create instance of generic, provide types belong it.

in simple example, write generic function adds 2 numbers. can create instance of function int types, add ints, or float types add floats, ettc. know can done overloading, generics go step further.

i'm doing, want create linked list class, list of structs contain next pointer, previous pointer, , data. pointers of course of type of struct, data want able pass in type of data (for each linked list object, data won't change, want able have multiple linked list objects, each 1 might have different data type).

if gets i'm talking about, please let me know.

templates


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Generics for C++ ?


Ubuntu

Comments

Popular posts from this blog

Static ip - Raspberry Pi Forums

arduino bug sur secteur, batterie, mais pas en usb?

What voltage is sent to the arduino GND when a transistor is used