| | |
How to use typedef for the template structure? What its syntax?
![]() |
•
•
Join Date: Jun 2008
Posts: 86
Reputation:
Solved Threads: 5
•
•
•
•
I didn't get what your syntax says.
Can you kindly explain it..
•
•
•
•
Typedef name is an alias for the type, it's not a new type name.
Can you explain what a problem are you trying to solve with "generic typedef"?
But lets say If i want to create the pointer variable.
like for example normally what we do is
C++ Syntax (Toggle Plain Text)
struct box { ... blah .. blah.. blah }; typedef box *crazy_box; //as we can now easy create the pointer with crazy_box crazy_box B1;
Now I want this to happen with the template structure what to do...
Last edited by Rhohitman; Oct 10th, 2008 at 7:23 pm.
Chazing Dreams ;'P
Shhhh.......ZZzzzzzzzzzzzzzzzzzzzz.....
Shhhh.......ZZzzzzzzzzzzzzzzzzzzzz.....
•
•
•
•
Hehe...
C++ Syntax (Toggle Plain Text)
template<typename T> struct MyGreatBeautifulBox:box<T>{}; int main() { MyGreatBeautifulBox<int> ibox; MyGreatBeautifulBox<char> cbox;
Chazing Dreams ;'P
Shhhh.......ZZzzzzzzzzzzzzzzzzzzzz.....
Shhhh.......ZZzzzzzzzzzzzzzzzzzzzz.....
![]() |
Other Threads in the C++ Forum
- Previous Thread: number of ways to..ehh, i hate counting ways
- Next Thread: Using c++ to send email with smtp
| Thread Tools | Search this Thread |
api array based binary bitmap business c++ c/c++ char class classes code coding commentinghelp compile console conversion count decide delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez graph guess gui homeworkhelp homeworkhelper iamthwee ifpug ifstream incrementoperators infinite input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem proficiency program programming project python random read recursion reference rpg string strings temperature template templates test text text-file tree url variable vector video win32 windows winsock word wordfrequency wxwidgets






