
I have started trying to templatize c2_functions, but I have a question for the Boost group. Realistically, this class is fairly meaningless for anything other than double and long double types. I also have a long, enduring distaste for c++ templates and, as a result, little deep competence with them. The process of making it into working template classes which are also fairly easy to use will be very slow for me. For the 99% of users who will always use this with double, also, the need to declare every items with <double> after it, or even with <> for things which can be defaulted, is ugly and will likely reduce the user base. Would it be objectionable to the Boost concept to release a basic version of the which is strictly for doubles, with the knowledge that, for the few people who want it for long doubles, this can be done with a global search & substitute, and then to plan later for a successor to this which is fully templatized? I see this as a package which, in its current, template-free form, can be essentially spun off except for improving the documentation. The algorithms in it are simple and robust, and the code should be highly portable, so I doubt it will every need much maintenance. I think there is a fairly decent reason to make it available soon, since there appears to be a significant need for it, and to learn if real users need it structured differently. Marcus

Marcus Mendenhall wrote:
I have started trying to templatize c2_functions, but I have a question for the Boost group. Realistically, this class is fairly meaningless for anything other than double and long double types. I also have a long, enduring distaste for c++ templates and, as a result, little deep competence with them. The process of making it into working template classes which are also fairly easy to use will be very slow for me. For the 99% of users who will always use this with double, also, the need to declare every items with <double> after it, or even with <> for things which can be defaulted, is ugly and will likely reduce the user base.
Would it be objectionable to the Boost concept to release a basic version of the which is strictly for doubles, with the knowledge that, for the few people who want it for long doubles, this can be done with a global search & substitute, and then to plan later for a successor to this which is fully templatized?
I see this as a package which, in its current, template-free form, can be essentially spun off except for improving the documentation. The algorithms in it are simple and robust, and the code should be highly portable, so I doubt it will every need much maintenance. I think there is a fairly decent reason to make it available soon, since there appears to be a significant need for it, and to learn if real users need it structured differently.
You've come to the right place. Here are the template experts. Instead of "release" without template support, why not collaborate with someone to help with the process? ** It's not just the data types that you would want to be generic. It's the containter types as well. There are hard-coded instances of std::vector, for example. From what I've seen in this code, fixing this aspect is easy.

Marcus Mendenhall wrote:
I have started trying to templatize c2_functions, but I have a question for the Boost group. Realistically, this class is fairly meaningless for anything other than double and long double types. I
what is wrong with float ? or even Half floats? assuming the user's precision does not need more than that
Would it be objectionable to the Boost concept to release a basic version of the which is strictly for doubles, with the knowledge that, for the few people who want it for long doubles, this can be done with a global search & substitute, and then to plan later for a successor to this which is fully templatized?
sounds like a typedef would solve this to me, template <typename realType = double, typename container = std::vector<realType> > class NotSoEasyForUser { ... } // this is a convenience type typedef NotSoEasyForUser<> EasyForUser; with this form you wouldn't even need to provide defaults. It is also reasonably easy to use compile time constraints to ensure that the types passed to the template instansiation have to correct concepts, for example realType truly is a type with the properties of a real number or if not then a sensible error can be generated by the compiler, Boost has a number of facilities to aid with this (BOOST_STATIC_ASSERT comes to mind). Kevin -- | Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this | | Senior Technology | My employer for certain | | And Network Systems Architect | Not even myself |

| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Marcus Mendenhall | Sent: 26 March 2006 19:29 | To: boost@lists.boost.org | Subject: [boost] more thoughts on c2_functions | | I have started trying to templatize c2_functions, but I have a | question for the Boost group. Realistically, this class is fairly | meaningless for anything other than double and long double types. Although in this case, I cannot see a big use for this by the embedded people who tend to only have float available, I can see an important use for long double (especially if MS ever get round to implementing it properly - though I'm not holding my breath). So I would strongly favour a templated version, provided it doesn't cause the 'doubles-only' users inconvenience. I'm sure you will not be short of Boosters advice on how to do this ;-) Paul -- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204 mailto: pbristow@hetp.u-net.com http://www.hetp.u-net.com/index.html http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html
participants (4)
-
Kevin Wheatley
-
Marcus Mendenhall
-
Neal Becker
-
Paul A Bristow