Re: [boost] Any interest in a string literal selector helper library?

2003-09-01 Thread John Torjo
Subject: [boost] Any interest in a string literal selector helper library? > Hi all, > > I have written a relatively small library which I've found pretty useful > in my own projects. I have to deal with std::basic_string objects a lot > in my applications, and I almost always write template co

Re: [boost] boost::filesystem file restrictions

2003-08-18 Thread John Torjo
> The current approach is clearly too restrictive and isn't satisfactory. > Beyond the problems you mention, there really isn't a single standard for > portability. Even 8.3 names aren't portable to systems which don't allow > periods in names. A whole family of checkers is needed, giving various >

Re: [boost] Re: Re: Re: Re: Re: Re: Re: Re: GUI/GDI template library

2003-08-14 Thread John Torjo
> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > > On Behalf Of John Torjo > > Sent: Monday, August 04, 2003 11:36 AM > > To: Boost mailing list > > Subject: Re: [boost] Re: Re: Re: Re: Re: Re: Re: Re: GUI/GDI template > > library > > > > Hi, &

Re: [boost] GUI/GDI template library

2003-08-14 Thread John Torjo
Hi Eugene, I know this is a little late ;), but I've been so busy lately. I took a look at guist.zip. Well, I have to say that I don't like it :( Basically, I don't think you should be concerned about data at such a low level. I think there should be a layer that represents gui objects (windows

Re: [boost] [date_time] improvements

2003-08-14 Thread John Torjo
> > Ok, sure. I can't really see anything wrong with your argument. That said, > I still don't want to change this lightly. While this would make life > easier for users, they are already used to the library. If I get rid of it > and then want/need it back it won't be nice. So I'll put this on

Re: [boost] Re: Any interest in iostream-like pipe?

2003-08-14 Thread John Torjo
> Larry Evans wrote: > > > [snip] > > indicating some interest in combining thread safety and > > decoration. It seems to me (a novice in threading) that > > what needs to be protected is the access to the end > > of the pipeline, i.e. the final streambuf, which is > > connected to the actual ou

Re: [boost] Re: automating registering of events (was: Re: GUI/GDItemplatelibrary)

2003-08-14 Thread John Torjo
> > AFAIK, some gui toolkits use not event, but callback system. > IMHO it is more evective. Definitely it should be discussed > carefully. > Aren't we talking about the same thing? ;) In response to an event, you call an event callback. That's what my example does - it's obfuscated indeed, but

Re: [boost] GUI/GDI template library

2003-08-12 Thread John Torjo
>The confusion is that your interpretation (more >traditional) of a modern GUI framework is a bit >different from notus. We are not concerned with >building low-level controls. The low-level >implementation is basically proveded by the platform >(Mac, win32, etc.). Notus is just going to be usin

automating registering of events (was: Re: [boost] GUI/GDI templatelibrary)

2003-08-12 Thread John Torjo
Eugene, one more thing when you implement the GUI library. I ALWAYS hated the message maps from MFC/WTL. So now I came up with a quite cute method of automating registering of events for a given window. (this should work for registering messages, etc.) It's very flexible. In other words, whe

[boost] Re: Any interest in iostream-like pipe?

2003-08-12 Thread John Torjo
> > http://lists.boost.org/MailArchives/boost/msg46513.php > > indicating some interest in combining thread safety and > decoration. It seems to me (a novice in threading) that > what needs to be protected is the access to the end > of the pipeline, i.e. the final streambuf, which is > connected

Re: [boost] Re: Re: smart_assert - update; SMART_ENFORCE works

2003-08-08 Thread John Torjo
Hi Michael, Sorry for the late reply... > > A postcondition such as I'm suggesting would perform an assertion when a > function (or the enclosing block) exits instead of on the line where the > assertion was defined. Obviously, if a function only has one exit path, it > would be simple just to pu

Re: [boost] Re: Proposed smart_handle library

2003-08-06 Thread John Torjo
> > I might not have followed the discussion to deeply, but it does look to me > like John is entirely right. Traits can fundamentally do one customization > per type. That's not going to be enough if you have the same type > representing multiple handles, as is the case with many C APIs. For examp

Re: [boost] Infinite number of parameters?

2003-08-05 Thread John Torjo
> > #include > > > using namespace std; > > > namespace infinite > { > > > template > struct typelist : U > { > typedef T type; > > T value; > > typelist(T const & a, U const & b) : value(a), U(b) {} > }; > > template <> > struct typelist > { > typedef void type; > }; > > template

Re: [boost] Re: Re: Re: Re: Re: Re: Re: Re: GUI/GDI template library

2003-08-04 Thread John Torjo
Hi, I tried compiling the boost_gui code, but got compile-time errors. Do I need a Service pack? Example: desired_size_operations.cpp d:\john\programming\boost\boost_gui\boost_gui\floatroutines.h(8) : error C2065: 'pow' : undeclared identifier d:\john\programming\boost\boost_gui\boost_gui\floatr

Re: [boost] [date_time] improvements

2003-08-04 Thread John Torjo
Hi Jeff, > > > Told you I'd come back for more ;) > > Here are some more improvements I would consider useful: > > > > [1] > > unary operator-(time_iterator). > > Example: -hours(24) instead of hours(-24). > > (seems more straightforward) > > I see your point, but then don't you have to add all the

[boost] [date_time] improvements

2003-08-04 Thread John Torjo
efficient as time_t in release mode) In debug mode, each value contains a user-friendly string corresponding to the time_t value. As a side-note, this could be made much more general, to work for other HANDLE-like types (for instance, HWND in Win32 or so). What do you think? Best, John --

Re: [boost] Fun PP lib example

2003-08-04 Thread John Torjo
> > Here's an example I just cooked up of using the PP lib to solve a > classic C++ OO problem: repeated boilerplate in the definition of > Pimpl classes. Paul, if you want to put it (or something like it) in > the PP lib docs, you're welcome to. > Hi Dave, Pretty cool! Small note: instead of 'in

Re: [boost] Re: smart_assert - update; SMART_ENFORCE works

2003-08-04 Thread John Torjo
Hi Michael, > > 1) How is this going? > Unfortunately, I've been EXTREMELY busy these days :( It's almost done - I've worked on making a small footprint of SMART_ASSERT (when using SMART_ASSERT, the generated code should be as small as possible) Note: try the latest version - www.torjo.com/smar

Re: [boost] Re: Re: GUI/GDI template library

2003-08-04 Thread John Torjo
> > 1. i'm 99% sure that plain > > resource language or even XML is much cleaner than c++ bindings- > > templates-operators mess. > > Templates aren't always beautiful, but this library is targeted towards > C++ programmers who should be familiar with them. We've had the STL for > ov

Re: [boost] Re: Re: Re: GUI/GDI template library

2003-08-04 Thread John Torjo
> > 2. is there potential to identify a "generic state > > machine" > > that can be part of your gui templates/library > > without > > getting tangled in the application specific > > machines. i > > One more on the state machines. Even the standard > button control is a state machine (when you p

Re: [boost] Re: GUI/GDI template library

2003-08-04 Thread John Torjo
> It might not be too hard to make the GUI objects 'serialize' themselves > into a native resource file but this would be useless without something > to convert a resource file back into C++ code. Something like this > could be written on top of a pure C++ solution with the help of a > serializat

Re: [boost] GUI/GDI template library

2003-07-26 Thread John Torjo
> I was thinking about designing a GUI/GDI template > library. > > The main ideas are: > 1. Create a portable template abstraction for standard > GUI/GDI elements and dialog boxes. > 2. Design an "iterator-like" interface. > 3. The most important goal is design a natural > connection between S

Re: [boost] spatial and metric containers

2003-07-26 Thread John Torjo
> SMTL aims to efficiently solve queries like: > > a) Which books where written by authors whose last name begins with >"B" between 1986 and 1994? > b) How many cities with population above 10,000 are located between >such and such latitude and such and such longitude? > c) Which is the cl

Re: [boost] date_time small feature request

2003-07-24 Thread John Torjo
> > > For instance, if I want to iterate 1 and a half days, I think it's more > > expressive to say: > > > > time_iterator it( start, days(1) + hours( 12)) instead of: > > > > time_iterator it( start, hours( 36)) > > It's pretty easy to add this yourself if you want: > > class days : public boost::

[boost] date_time small feature request

2003-07-23 Thread John Torjo
ance, if I want to iterate 1 and a half days, I think it's more expressive to say: time_iterator it( start, days(1) + hours( 12)) instead of: time_iterator it( start, hours( 36)) Best, John -- John Torjo -- "Practical C++" column writer for builder.com.com Freelancer, C++ cons

Re: [boost] Re: current_function.hpp extension

2003-07-22 Thread John Torjo
> > John Torjo schrieb: > > > Exactly! Don't do anything! But in order not to do anything, I need to know > > whether the compiler support a FUNCTION-like macro or not. > > > > Otherwise, I won't know (and assume it has), and print to the user some

Re: [boost] Re: current_function.hpp extension

2003-07-22 Thread John Torjo
> John Torjo wrote: > > > Yes, I remain unconvinced ;-) > > This is because some compilers do not provide such a FUNCTION facility. > > VC6 is one of them. What should I do for it? > > It sounds like you are asking for the wrong macro! > You are trying to suppor

Re: [boost] Re: Proposed smart_handle library

2003-07-20 Thread John Torjo
> > Using operator->() and operator*() you use "pointer value itself". It is > pretty rare situation when you need it directly and not as part of > abc->def() or *abc constructs. Example of c_str() is irrelevant --- you can > do all string manipulations without c_str(). The former is needed to > in

Re: [boost] Re: Proposed smart_handle library

2003-07-20 Thread John Torjo
> Alan Bellingham <[EMAIL PROTECTED]> writes: > > >>did they give you the name of this library? > > > > Presumably this is WTL - the Windows Template Library. > > That's the one. > -- I've used it and it's great! I hated MFC for a long time, WTL is indeed cool! And as far as I know it's develop

Re: [boost] current_function.hpp extension

2003-07-20 Thread John Torjo
Hi Peter, > > If a compiler has a current function facility but is not currently supported > by current_function.hpp, if you show '(unknown)' users of this compiler will > spot the problem and submit a patch, or at least report it to us. > > If not, they may not even realize that the library could

Re: [boost] current_function.hpp extension

2003-07-19 Thread John Torjo
> On the other hand, perhaps you have a use case that clearly demonstrates the > need for BOOST_HAS_CURRENT_FUNCTION? The SMART_ASSERT library clearly needs it. The idea is: when an assertion fails, in case BOOST_CURRENT_FUNCTION holds a meaningful value, I want to show it. Otherwise, not. Test

Re: [boost] About member extraction

2003-07-14 Thread John Torjo
> >Subject: Re: [boost] About member extraction > From: Joaquín Mª López Muñoz <[EMAIL PROTECTED]> > Date: Mon, 14 Jul 2003 14:24:37 +0200 > To: Boost mailing list <[EMAIL PROTECTED]> > > > >Daryle Walker ha escrito: > >> But doesn't the "PtrToMember" template parameter already imply the >>

Re: [boost] Re: smart_assert and range_ template

2003-07-11 Thread John Torjo
Hi Danny, > > http://www.cuj.com/documents/s=8464/cujcexp0308alexandr/) > > > > Here's an excerpt of some code: > > I have some problems to see the connection between smart_assert and your > errounous code below. Can you explain? The code shown below is from the smart_assert (www.torjo.com/smart_

Re: [boost] smart_assert and range_ template

2003-07-10 Thread John Torjo
- Original Message - From: "popov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 08, 2003 8:03 PM Subject: [boost] smart_assert and range_ template > (not sure it's the right place to post this, but it seems smart_assert is > (or will) be part of boost, and I can't get

Re: [boost] Re: BOOST_STATIC_ASSERT - a little better

2003-06-23 Thread John Torjo
- Original Message - From: "Pavel Vozenilek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 20, 2003 12:38 PM Subject: [boost] Re: BOOST_STATIC_ASSERT - a little better > > "John Torjo" <[EMAIL PROTECTED]> wrote in message &g

[boost] iterator_adaptors.hpp - typo?

2003-06-23 Thread John Torjo
ible::value)); ...etc. Best, John -- John Torjo -- "Practical C++" column writer for builder.com.com Freelancer, C++ consultant mailto:[EMAIL PROTECTED] ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

[boost] BOOST_STATIC_ASSERT - a little better

2003-06-19 Thread John Torjo
, but we can modify the code to work with a lot more compilers). What do you think? Best, John -- John Torjo -- "Practical C++" column writer for builder.com.com Freelancer, C++ consultant mailto:[EMAIL PROTECTED] namespace boost { template struct STATIC_ASSERTION_FAILURE_BASE; temp

Re: [boost] RE: Interest in library generating streambufs fromobjects

2003-06-10 Thread John Torjo
> Thanks for your interest. I have posted the library at > http://groups.yahoo.com/group/boost/files/streambuf_lib/. > Wow! I have not had too much time, but by the looks of it, it's great! I'm sure interested in this! Best, John ___ Unsubscribe & o

[boost] smart_assert - update; SMART_ENFORCE works

2003-06-03 Thread John Torjo
he documentation the following days. -- John Torjo -- "Practical C++" column writer for builder.com.com Freelancer, C++ consultant mailto:[EMAIL PROTECTED] smart_assert.zip Description: Zip compressed data ___ Unsubscribe & other changes:

[boost] Re: new version comments

2003-06-02 Thread John Torjo
> Hello John, > > I tried assert lib under Borland C++ Builder and Intel C++ and bellow are > few notes so far. > > There seems to be recursive loop bug (item 10). > > /Pavel > > PS: it is sooo big: 20 headers and > 100kB of source. I would never imagine > old > #define assert(x) if (!(x)) abort(

[boost] Re: fix of fix

2003-06-02 Thread John Torjo
- Original Message - From: "Pavel Vozenilek" <[EMAIL PROTECTED]> To: "John Torjo" <[EMAIL PROTECTED]> Sent: Friday, May 30, 2003 10:39 PM Subject: fix of fix > Hello John, > > The code I sent before to disable warning isn't the best. >

[boost] smart_assert - update.

2003-05-30 Thread John Torjo
evels of assertion. persistent_asserts.cpp - to get a feel of persistence. Try all of the Ignore options! using_logger_array.cpp - using logger_array class, to log to multiple places. Check out outputting to the Debug Window (on Win32/ Visual C)!!

Re: [boost] Re: Formal Review: Command Line & Config library

2003-05-27 Thread John Torjo
> > - does not work for wchar_t. While this might seem silly, it's not, since > > VC allows for a TCHAR* command line string. > > I have to consider this. An obvious approach would be to add template > parameter to every class, telling which char type to use. So investigation > is needed to find al

Re: [boost] Re: Enum operators

2003-05-27 Thread John Torjo
- Original Message - From: "Reece Dunn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 27, 2003 1:57 PM Subject: Re: [boost] Re: Enum operators > I have adopted a Java-style approach to enumerated-style values (don't know > if this is the best approach, just the way that

Re: [boost] smart assert (was: ENFORCE/ better assertion technique)

2003-05-25 Thread John Torjo
eks, but if no-one > has taken up the challenge I'll have another go then. > > > > John Torjo wrote: > > > >>>>>Following on from that, there seems some overlap between your proposed > >>>>>asserts and Boost.Test's BOOST_CHECK

[boost] smart_assert - static_initializer fails

2003-05-23 Thread John Torjo
(*f)()> void_initializer< f>::internal void_initializer< f>::s_internal = 0; void f() { std::cout << "f()" << std::endl; } int main() { // does NOT call f() !!! void_initializer< &f> v; std::cin.get(); return 0; } Thanks. Best, Jo

[boost] Re: smart assert library comments

2003-05-22 Thread John Torjo
Hi Pavel, > Hello John, > > > > 1. #include may be replaced with #include > > > > > > However Dimkunware C++ library for MSVC 6 does put functions > > into > > > std:: namespace, so > > > > Unfortunately, it's not true (at least not for my MSVC6 ;-)) > > > My typo. It should be DOESN'T. > > #in

[boost] Re: one small assert fix

2003-05-22 Thread John Torjo
- Original Message - From: "Pavel Vozenilek" <[EMAIL PROTECTED]> To: "John Torjo" <[EMAIL PROTECTED]> Sent: Thursday, May 22, 2003 11:25 PM Subject: one small assert fix > boost/smart_assert.hpp can have code: > > #ifndef ... > #define

Re: [boost] Re: smart assert library comments

2003-05-22 Thread John Torjo
> John Torjo wrote: > >> 3. In addition to __FUNCTION_ GCC has __PRETTY_FUNCTION__ and C99 > >> __func__ (I think). Other platforms may have their own (like > >> __function__). > > > > Thanks! > > Basically, I would be interested in all of these un

Re: [boost] Re: Re: smart assert (was:ENFORCE/betterassertiontechnique)

2003-05-22 Thread John Torjo
> > However, given the generally accepted meaning of an assertion, I > have no problem with using BOOST_ASSERT for debug only tests and > BOOST_VERIFY for debug and release tests. (Another name might be > BOOST_CHECK.) I don't do Windows programming -- or at least I > haven't done any in a few ye

Re: [boost] Re: Re: smart assert (was: ENFORCE/betterassertiontechnique)

2003-05-08 Thread John Torjo
> > If VERIFY is used in MFC to mean an assert even in release mode then that > is > > probably the best name. > In MFC it doesn't have that meaning though. It means that the expression > passed to VERIFY will get evaluated in the release build but the result of > this expression will not get che

Re: [boost] Re: ENFORCE

2003-05-08 Thread John Torjo
> > That's right. But if this will ever get into boost maybe we'll better > use the classical do-while(0). Borland warns on if(false), and > assert(false) is quite common, for instance, in the default case of > switch statements. BOOST_INVARIANT(false) could be used similarly > (Though, depending o

Re: [boost] Re: smart assert (was: ENFORCE/ betterassertiontechnique)

2003-05-08 Thread John Torjo
> #include > > struct Keeper > { > Keeper(int) {} > operator bool() { return false; } > > template< class type> > void log( const type & val, const char * str) > { std::clog << str << "=" << val; } > }; > > template< class type> > struct log_me_t > { > log_me_t( const v

Re: [boost] Re: smart assert (was: ENFORCE/ betterassertiontechnique)

2003-05-08 Thread John Torjo
> > Under win32, my assert method uses > > > > if (IsDebuggerPresent()) > > { > > DebugBreak();// ammounts to int 3 on intel > > } > > Maybe that is the 4th alternative I couldn't think of earlier :-). I also > thought of one more: emailling the system administrator. Useful on servers. Ind

Re: [boost] Re: smart assert (was: ENFORCE/ better assertiontechnique)

2003-05-08 Thread John Torjo
> Darren Cook wrote: > > > > In my own assert library I added options for logging, but in the end > > never used that and always had it throw an exception. This is nice for > > two reasons: > > 1. MFC debugger catches it and allows me to go back up the call stack > > to where the assert happene

Re: [boost] Re: smart assert (was: ENFORCE/ betterassertiontechnique)

2003-05-08 Thread John Torjo
> >>BOOST_ASSERT(some_lenghty_function())(???) > > > > 2. BOOST_ASSERT( some_lengthy_function() > 10) some_lengthy_function()); > > Indeed, is kind of lengthy, but this is life :-( > > The point is that I could provide the v_ macro as well - it would not be too > > complicated. What do others th

Re: [boost] smart assert (was: ENFORCE/ better assertion technique)

2003-05-08 Thread John Torjo
> > 4. In case an assertion has failed, two actions will occur: > > - first, the assertion will be logged > > - second, a message will be show to the user, and the user can choose from > > multiple actions, like Ignore, Retry, Abort, etc. > > > > These are SEPARATE actions, and are both customiza

Re: [boost] Re: class proposal

2003-04-24 Thread John Torjo
> void f( in_out< int > is_not_changed_ ) > { > // use is_not_changed_, but don't change it > } I think there would be a much bigger problem (code inside the function would change). Just consider void add_char( std::string & str, char ch) { str += ch; } Now, if we change it so be in_

Re: [boost] Re: better assertion technique

2003-04-23 Thread John Torjo
> > > > > > The output of the above (in case the assertion fails) can look like: > > > > > > Assertion failed: > > > '(v_(i) < v_(j)) || (i < 0) || (v_(k) == -1)' > > > i= '3' > > > j= '2' > > > k= '1' > > > > > This feature looks handy. Short macro like "v_" is IMHO acceptable, it > won't > > clas

Re: [boost] Re: better assertion technique

2003-04-23 Thread John Torjo
> > I wounder if it could be somehow merged with > http://www.cuj.com/experts/2104/alexandr.htm?topic=experts ? I've read the article. Great piece. I think we could do it. In case it's needed. Best, John ___ Unsubscribe & other changes: http://list

[boost] thread-safe ostream access

2003-04-02 Thread John Torjo
idx << " to log.\n"; log.flush(); } I will write a more detailed description soon. Best, John -- John Torjo -- "Practical C++" column writer for builder.com.com Freelancer, C++ consultant mailto:[EMAIL PROTECTED] ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost