Hi Richard,
On Wed, 6 Nov 2002, loopylozzysdad wrote:
Richar> Hi,
Richar>
Richar> I did work out the answer to my own question. I can't explain
Richar> how/why this works but by copying from the header files I ended up
Richar> with the following changes to Jeremy's posted code...[1]
Richar> Good luck if you want it - please don't ask me to explain it!
I can explain it :)
As hinted by the #ifndef, the commented out version of container_gen uses
partial specialization. The first parameter to container_gen is
specialized, but the second is left as a template. Partial spec. is not
yet supported by VC++ (but soon will be).
The change you made is one of the classic ways of replacing partial
specialization with full specialization. You remove the unspecialized
parameter, and instead add a nested class template (here it is bind_).
Cheers,
Jeremy
Richar> Richard
Richar>
Richar>
Richar> [1]
Richar> Comment out from original ....
Richar> //struct ordered_set_by_nameS { };
Richar>
Richar> //#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Richar> //namespace boost {
Richar> // template <class ValueType>
Richar> //struct container_gen