I did a google search and this is the top hit. I saw this as an example in a book but I can't remember which book it was. Sorry. But, hopefully, this example will get you started.
Roman Numeral Conversion
User Profile
Collapse
-
Is this with IBM's xlC or is it with gcc?
I have not seen that error. My guess is that you are passing an object not by reference or something similar to that (returning an object not by reference).Leave a comment:
-
Someone please check my syntax but something like:
Now you can do a couple of things. One is:Code:template <int size> struct _STRUCT1 { integer var1[size]; };
or you can put the use of the template inside the struct like:...Code:typedef _STRUCT1<100> s100; typedef _STRUCT1<200> s200; struct foo { s100 s1; s200 s2; };Leave a comment:
-
Help needed with bus access classes
I am trying to write a set of classes, probably template classes, to allow "pretty" and safe access to low level machine words.
The syntax I would like to end up with is something like:
where handle would represent, in this case, the PCI config space, vendor_id is a particular offset into that space, and get is a method to retrieve the current value.Code:foo = handle.vendor_id.get();
To add complexity,...
No activity results to display
Show More
Leave a comment: