[GSOC] Safe variable template class, input wanted!

Hello boost developers, My mentor and I are working on a safe variable template class this summer in the spirit of the GSOC even though we where not selected to get any funds for it. We would like to know what our fellow boost/c++ developers would like to see in a safe variable template class and what not, you can see what we are aiming for in the document bellow. http://svn.boost.org/trac/boost/browser/sandbox/SOC/2008/safe_variable/boost... We look forward to your input.

On Wed, Jun 18, 2008 at 1:33 PM, Youssef Oujamaa <youssef.oujamaa@gmail.com> wrote:
My mentor and I are working on a safe variable template class this summer in the spirit of the GSOC even though we where not selected to get any funds for it. We would like to know what our fellow boost/c++ developers would like to see in a safe variable template class and what not, you can see what we are aiming for in the document bellow.
Hi Youssef, Kudos on your decision! I briefly looked at your proposal and it seems like a useful project. I have a few comments for you: * SafeVariable seems like a good name for the library (or maybe even SafeValue?), but for the class template itself why not just 'safe'? So you have safe<int>, safe<double>, etc... * I really like that you're making both static and dynamic versions. * boost programming guidelines say to avoid exception specifications in code (http://www.boost.org/development/requirements.html#Exception-specification), but I'm not familiar with the specifics of exception specification, and maybe in your case it doesn't hurt. * The operators lib might be useful to you (http://www.boost.org/doc/libs/1_35_0/libs/utility/operators.htm) - you might know this already * returning things by value (e.g., from min and max) might be OK for types like int and double, but for more heavy class types you may want to return by const & . Except for the static version, where I guess you have to return by value (or by && in C++0x). The call traits library might have something to help give you the right return type for the dynamic version. * is there / should there be any overlap between a safe value and a bounded value library (e.g., when you want the value to wrap on overflow etc.)? I noticed you allow customization of overflow behavior so maybe this is something you have in mind? Best, Stjepan

Hi Youssef,
From: Youssef Oujamaa
Hello boost developers,
My mentor and I are working on a safe variable template class this summer in the spirit of the GSOC even though we where not selected to get any funds for it. We would like to know what our fellow boost/c++ developers would like to see in a safe variable template class and what not, you can see what we are aiming for in the document bellow.
http://svn.boost.org/trac/boost/browser/sandbox/SOC/2008/safe_ variable/boost_gsoc_2008.pdf
We look forward to your input.
It looks like your library is going to duplicate much of the functionality of the library I'm going to submit for a formal review in a short time: Boost Constrained Value library (see docs here: http://rk.go.pl/r/constrained_value). In brief, the library is about creating wrappers for objects that allow only to assign values valid according to a predicate. The library doesn't contain SafeInt functionality, however, because I feel that the issues of constraining the set of possible values and avoiding arithmetic oferflows are separate and should be addressed by distinct libraries. I think you may find some other useful information searching this group's archives, there were several discussions on similar topics in the past. Best regards, Robert

Youssef Oujamaa wrote:
Hello boost developers,
My mentor and I are working on a safe variable template class this summer in the spirit of the GSOC even though we where not selected to get any funds for it. We would like to know what our fellow boost/c++ developers would like to see in a safe variable template class and what not, you can see what we are aiming for in the document bellow.
http://svn.boost.org/trac/boost/browser/sandbox/SOC/2008/safe_variable/boost...
We look forward to your input.
I would be interested in seeing some "bounded value" utility in boost. I saw that you only planned one week of discussions on this developers list. If you really plan on getting your library accepted you probably need to spend a lot more "absolute time" discussing it. After you have a fairly good implementation and documentation you can submit it for a formal review, see http://www.boost.org/development/submissions.html. Unfortunately it can take several months from review submission until the formal review begins. Still, even if you don't have the time to get your library into boost, someone else can pick up where you left off and get it boostified. So I hope you try :) Have you found any older C++ implementations? Johan -- View this message in context: http://www.nabble.com/-GSOC--Safe-variable-template-class%2C-input-wanted%21... Sent from the Boost - Dev mailing list archive at Nabble.com.

Hi, Youssef Oujamaa wrote:
My mentor and I are working on a safe variable template class [...] We look forward to your input.
Implementing this in pure C++ can be fun, but keep in mind possible disadvantages - these are mentioned at the beginning of this page: http://www.msobczak.com/prog/typegen/ Cheers, -- Maciej Sobczak * www.msobczak.com * www.inspirel.com
participants (5)
-
Johan Torp
-
Maciej Sobczak
-
Robert Kawulak
-
Stjepan Rajko
-
Youssef Oujamaa