Re: [boost] Re: io operations for stl containers?

2003-03-28 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > > >From: "Jason House" <[EMAIL PROTECTED]> > > > > > 1. Is it at all useful/possible to use a lambda-like notation? > > > Thinking about it more, I don't know how doable it is for the first 3 > parameters... > > But what about:

[boost] Re: io operations for stl containers?

2003-03-28 Thread Jason House
Terje Slettebø wrote: > > >From: "Jason House" <[EMAIL PROTECTED]> > > > I had 2 thoughts today... > > > > 1. Is it at all useful/possible to use a lambda-like notation? > > In what way? Could you have given a rough syntax-example? > > An example in BLL is: > > std::for_each(v.begin(), v.end

Re: [boost] Re: io operations for stl containers?

2003-03-27 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > I had 2 thoughts today... > > 1. Is it at all useful/possible to use a lambda-like notation? In what way? Could you have given a rough syntax-example? An example in BLL is: std::for_each(v.begin(), v.end(), std::cout << _1 << '\n'); >In the past,

[boost] Re: io operations for stl containers?

2003-03-27 Thread Jason House
I had 2 thoughts today... 1. Is it at all useful/possible to use a lambda-like notation? In the past, I've liked the look of that a lot. (the comments about alternate notation made me think of it) 2. Why are we restricting the output to strings? Couldn't the types of the 3 delimiter stri

RE: [boost] Re: io operations for stl containers?

2003-03-26 Thread Rozental, Gennadiy
> > I am afraid boost/io/format will be confusing in a sight of > presence of > > Boost.Format. > > I understand. Well, it's in a different namespace. I do not know why BTW. But even if it stays this way, I easily see a newbie looking for Boost.Format staff in your headers and vise-vesa > The

Re: [boost] Re: io operations for stl containers?

2003-03-26 Thread Terje Slettebø
>From: "Rozental, Gennadiy" <[EMAIL PROTECTED]> > > #include > > #include > > #include > > I am afraid boost/io/format will be confusing in a sight of presence of > Boost.Format. I understand. Well, it's in a different namespace. > I would prefer (since it all about container output formattin

RE: [boost] Re: io operations for stl containers?

2003-03-26 Thread Rozental, Gennadiy
> #include > #include > #include I am afraid boost/io/format will be confusing in a sight of presence of Boost.Format. I would prefer (since it all about container output formatting) boost/io/container Also it could be stl instead of std, though it's the matter of taste. > std::cout << forma

Re: [boost] Re: io operations for stl containers?

2003-03-26 Thread Terje Slettebø
Hi. I've now uploaded the latest version of the composite stream operators library at Yahoo Files (http://groups.yahoo.com/group/boost/files/composite_stream_operators/) and the Sandbox (boost/io/format/ and libs/io/format).. Since the libraries in the Sandbox use the boost namespace, this one do

Re: [boost] Re: io operations for stl containers?

2003-03-17 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > typedef std::vector vector_char; > > > > vector_char values; > > > > // Fill with 'A', 'B', 'C' > > > > std::cout << io::format("[", "]", ", ", "\'", "\'") << values; > > > > Output: > > > > ['A', 'B', 'C'] > > > > However, is th

[boost] Re: io operations for stl containers?

2003-03-17 Thread Jason House
Terje Slettebø wrote: > typedef std::vector vector_char; > > vector_char values; > > // Fill with 'A', 'B', 'C' > > std::cout << io::format("[", "]", ", ", "\'", "\'") << values; > > Output: > > ['A', 'B', 'C'] > > However, is this overkill? It seems that way, especially considering that

Re: [boost] Re: io operations for stl containers?

2003-03-16 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > > std::vector > test; > > > > std::cout << test: // Using defaults > > > > (('A',1),('B',2),('C',3)) > > I would suspect that chars don't get output with '' around them... > Is there even a way to specify/change that? Somethin

Re: [boost] Re: io operations for stl containers?

2003-03-09 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > > >From: "Jason House" <[EMAIL PROTECTED]> > > > > > Is there even a way to specify/change that? > > > > It isn't currently, as the fundamental types aren't handled as composite > > types, and therefore aren't formatted using

Re: [boost] Re: io operations for stl containers?

2003-03-09 Thread Terje Slettebø
>From: "Vladimir Prus" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > Right. There was a suggestion for allowing generic formats, though, using > > the same format for all instantiations of a template. The question is how > > to do it. The current version stores the format for each specific typ

[boost] Re: io operations for stl containers?

2003-02-26 Thread Jason House
Terje Slettebø wrote: > > >From: "Jason House" <[EMAIL PROTECTED]> > > I would suspect that chars don't get output with '' around them... > > Right. I was just thinking C++ code, here. :) > > > Is there even a way to specify/change that? > > It isn't currently, as the fundamental types aren't

Re: [boost] Re: io operations for stl containers?

2003-02-26 Thread Vladimir Prus
Terje Slettebø wrote: > Right. There was a suggestion for allowing generic formats, though, using > the same format for all instantiations of a template. The question is how > to do it. The current version stores the format for each specific type, as > you say. Volodya suggested a couple of ways i

Re: [boost] Re: io operations for stl containers?

2003-02-26 Thread Vladimir Prus
Hi Terje, [...] > > But you don't write library, put a seal on it, and stop. There's nothing > > wrong > > > with making it more flexible when users demand it. As it stands, only few > > persons are interested in the simplest facilities. Is it worth spending > > time > > on completely generic/fl

Re: [boost] Re: io operations for stl containers?

2003-02-25 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > > > > std::vector > test; > > > > std::cout << test: // Using defaults > > > > (('A',1),('B',2),('C',3)) > > I would suspect that chars don't get output with '' around them... Right. I was just thinking C++ code, here. :) > Is there even a way to specify

[boost] Re: io operations for stl containers?

2003-02-25 Thread Jason House
Terje Slettebø wrote: > > >From: "Jason House" <[EMAIL PROTECTED]> > > > Terje Slettebø wrote: > > > In a way, something good came from it, as well: I've recently looked at > > > Boost.Tuple, and I see that they have I/O operators defined (in > > > tuple_io.hpp). > > > > Well, it definitely see

Re: [boost] Re: io operations for stl containers?

2003-02-24 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > > >From: "Vladimir Prus" <[EMAIL PROTECTED]> > > > > Sorry for having taken so long to respond to these messages. I felt a need > > for a break, to consider how it might be done. > > I was wondering about this line of discussio

[boost] Re: io operations for stl containers?

2003-02-24 Thread Jason House
Terje Slettebø wrote: > > >From: "Vladimir Prus" <[EMAIL PROTECTED]> > > Sorry for having taken so long to respond to these messages. I felt a need > for a break, to consider how it might be done. I was wondering about this line of discussion earlier today... wondering if it died on the vine o

Re: [boost] Re: io operations for stl containers?

2003-02-24 Thread Terje Slettebø
>From: "Vladimir Prus" <[EMAIL PROTECTED]> Sorry for having taken so long to respond to these messages. I felt a need for a break, to consider how it might be done. In a way, something good came from it, as well: I've recently looked at Boost.Tuple, and I see that they have I/O operators defined

RE: [boost] Re: io operations for stl containers?

2003-02-10 Thread Paul A. Bristow
39 561830 Mobile +44 7714 33 02 04 Mobile mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Terje Slettebø > Sent: Friday, February 07, 2003 9:38 PM > To: Boost mailing list > Sub

[boost] Re: io operations for stl containers?

2003-02-10 Thread Jason House
Vladimir Prus wrote: > >>I'm pulling at stings, but there has to be good stuff to add if we come up > > > > with > > > >>the right aspect to develop. I have never heard of a library designed for > >>evaluation of debug-time expressions... It would be interesting to see > > > > how > > > >>powe

Re: [boost] Re: io operations for stl containers?

2003-02-10 Thread Vladimir Prus
Terje Slettebø wrote: From: "Jason House" <[EMAIL PROTECTED]> Terje Slettebø wrote: Regarding this project. I've got doubts about the viability of it. Well, I'm glad you've given it a greater level of thought. I really like the idea of the composite_format, and probably should try to

Re: [boost] Re: io operations for stl containers?

2003-02-07 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > Regarding this project. I've got doubts about the viability of it. > > Well, I'm glad you've given it a greater level of thought. I really like the idea > of the composite_format, and probably should try to do the same :) Tha

[boost] Re: io operations for stl containers?

2003-02-07 Thread Jason House
Terje Slettebø wrote: > Regarding this project. I've got doubts about the viability of it. Well, I'm glad you've given it a greater level of thought. I really like the idea of the composite_format, and probably should try to do the same :) > One thing is to create something useful. Another t

Re: [boost] Re: io operations for stl containers?

2003-02-07 Thread Terje Slettebø
Regarding this project. I've got doubts about the viability of it. One thing is to create something useful. Another thing is to create something useful as a _library_ component. As has been noted regarding application and library development, application development and library development is typi

Re: [boost] Re: io operations for stl containers?

2003-02-07 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Jason House wrote: > > > Terje Slettebø wrote: > > > > > Another possibility might be to have a sentry object, doing automatic state > > > saving and restoring in the constructor and destructor. In fact, there are > > > already such classes in Boost: Dary

Re: [boost] Re: io operations for stl containers?

2003-02-07 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > >From: "Jason House" <[EMAIL PROTECTED]> > > > I thought of one thing that might work reasonably well. > > > > > > How about making ++io_format< T > save the current format in a stack. > > > and having io_format< T>-- restore t

[boost] Re: io operations for stl containers?

2003-02-06 Thread Jason House
Jason House wrote: > Terje Slettebø wrote: > > > Another possibility might be to have a sentry object, doing automatic state > > saving and restoring in the constructor and destructor. In fact, there are > > already such classes in Boost: Daryle Walker's I/O state savers, which fits > > this sit

[boost] Re: io operations for stl containers?

2003-02-06 Thread Jason House
Terje Slettebø wrote: > >From: "Jason House" <[EMAIL PROTECTED]> > > I thought of one thing that might work reasonably well. > > > > How about making ++io_format< T > save the current format in a stack. > > and having io_format< T>-- restore the previously queuued format > > I've thought of the

Re: [boost] Re: io operations for stl containers?

2003-02-05 Thread Terje Slettebø
>From: "Larry Evans" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > >>From: "Vladimir Prus" <[EMAIL PROTECTED]> > > > >>Terje Slettebø wrote: > > [snip] > > > > std::cout << io_format("\n|","|\n","|") > > << io_format("---","---","---") > > << board << '\n'; > > } >

Re: [boost] Re: io operations for stl containers?

2003-02-05 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > > It should handle maps and pairs > > > reasonably well. I think that I have the same complaints about this as > > > io_manip > > > > > > The saving of information to the stream means that you can affect all > > > future outpu

[boost] Re: io operations for stl containers?

2003-02-05 Thread Jason House
Terje Slettebø wrote: > > It should handle maps and pairs > > reasonably well. I think that I have the same complaints about this as > > io_manip > > > > The saving of information to the stream means that you can affect all > > future output... > > > > For instance, if you have a type > > map >

Re: [boost] Re: io operations for stl containers?

2003-02-05 Thread Terje Slettebø
>From: "Terje Slettebø" <[EMAIL PROTECTED]> > const int array[3]; > > std::cout << array; > > MSVC 7 - C > Intel C++ 7 - C > g++ 3.2 - C > > const char array[3]; > > std::cout << array; > > MSVC 7- A (S or C) > Intel C++ 7 - C > g++ 3.2 - C > > std::cout << "Test"; > > MSVC 7 -

Re: [boost] Re: io operations for stl containers?

2003-02-05 Thread Terje Slettebø
>From: "Paul A. Bristow" <[EMAIL PROTECTED]> > This looks really neat - and potentially very useful. Thanks. :) > Sadly, array is one of the most interesting cases - so I'm sure I won't be the > only one 'watching this space'. I've looked more into it, and it seems this is a problem not just fo

Re: [boost] Re: io operations for stl containers?

2003-02-05 Thread Vladimir Prus
Terje Slettebø wrote: By the way, just for fun. Adding the following output operator for arrays, to the header I gave in the previous posting: --- |O|X|O| --- |X|X|O| --- |O|O|X| --- "Shall we play a game?" :) Sure thing :-) I guess you maybe got the "War Games" refer

RE: [boost] Re: io operations for stl containers?

2003-02-04 Thread Paul A. Bristow
This looks really neat - and potentially very useful. Sadly, array is one of the most interesting cases - so I'm sure I won't be the only one 'watching this space'. Thanks Paul PS composite_format is a bit long, but I can't suggest better. Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA

Re: [boost] Re: io operations for stl containers?

2003-02-04 Thread Terje Slettebø
>From: "Jason House" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > and given this: > > > > int main() > > { > > char board[3][3]= > > { > > {'O','X','O'}, > > {'X','X','O'}, > > {'O','O','X'} > > }; > > > > std::cout << io_format("\n|","|\n","|") > > << io_format("---","---","-

Re: [boost] Re: io operations for stl containers?

2003-02-04 Thread Terje Slettebø
>From: "Paul A. Bristow" <[EMAIL PROTECTED]> > This looks most useful - potentionally :-( > > Alas the two files, test and composite_stream_operators.hpp > > http://groups.yahoo.com/group/boost/files/composite_stream_operators/). > > won't compile on MSVC 7.0. > > test_composite_format.cpp > test_

Re: [boost] Re: io operations for stl containers?

2003-02-04 Thread Larry Evans
Terje Slettebø wrote: From: "Vladimir Prus" <[EMAIL PROTECTED]> Terje Slettebø wrote: [snip] std::cout << io_format("\n|","|\n","|") << io_format("---","---","---") << board << '\n'; } we get: --- |O|X|O| --- |X|X|O| --- |O|O|X| --- I've

[boost] Re: io operations for stl containers?

2003-02-04 Thread Jason House
Terje Slettebø wrote: > and given this: > > int main() > { > char board[3][3]= > { > {'O','X','O'}, > {'X','X','O'}, > {'O','O','X'} > }; > > std::cout << io_format("\n|","|\n","|") > << io_format("---","---","---") > << board << '\n'; > } > > we get: > > -

RE: [boost] Re: io operations for stl containers?

2003-02-04 Thread Paul A. Bristow
eptable conversion) with [ T=std::vector> ] test_composite_format.cpp(37) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'composite_format' (or there is no acceptable conversion) with

Re: [boost] Re: io operations for stl containers?

2003-02-04 Thread Terje Slettebø
>From: "Vladimir Prus" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > There are also some other issues: The current version assumes basic_string > > for the delimiters. I've found it hard to let it take an arbitrary string > > type, as the format-object (which the manipulator, basic_composite_f

[boost] Re: io operations for stl containers?

2003-02-04 Thread Vladimir Prus
Beman Dawes wrote: At 03:22 AM 2/4/2003, Vladimir Prus wrote: >Terje Slettebø wrote: >... Have you looked at Jen Maurer's persistence library? It was an elegant design and quite good at handling the issues you are discussing, IIRC. It is still in CVS under the branch "persistence-initial". B

[boost] Re: io operations for stl containers?

2003-02-04 Thread Vladimir Prus
Terje Slettebø wrote: I've some concerns, though: 1. Are "default" breaces/separators possible? I'd rather not use io_format every time I had to output a vector. Good point. As it is now, it just defaults to empty strings for the separators. Any idea how to specify such a default? If it's

Re: [boost] Re: io operations for stl containers?

2003-02-04 Thread Terje Slettebø
>From: "Vladimir Prus" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > Incidentally, I've just made a version that does exactly this. :) I've > > attached it, including a test, with this posting. > > I've take a look and I like it -- quite lean and does the work. Thanks. :) > I've some concern

[boost] Re: io operations for stl containers?

2003-02-04 Thread Vladimir Prus
Terje Slettebø wrote: This example should one case where manipulators are desirable: vector< vector > v; cout << v ; Here, each nested vector better go on a separate line. I suggest: cout << multiline << v; where "multiline" manipulator causes each element of the next output con

Re: [boost] Re: io operations for stl containers?

2003-02-03 Thread Terje Slettebø
>From: "Vladimir Prus" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > >>From: "Vladimir Prus" <[EMAIL PROTECTED]> > > > >>after having to output std::vector to stream again and again using custom > >>solution, I started to wonder why we don't have a solution in boost. > >>Does it makes sense to inc

[boost] Re: io operations for stl containers?

2003-02-03 Thread Edward Diener
Al Stevens who writes the C++ column for "Doctor Dobbs Journal" put out a persistent template library for C++ containers some time back. It is probably on the DDJ web site, although I haven't looked there recently. You might want to check that out and see what he did. I will readily admit I have no

[boost] Re: io operations for stl containers?

2003-02-03 Thread Vladimir Prus
Terje Slettebø wrote: From: "Vladimir Prus" <[EMAIL PROTECTED]> after having to output std::vector to stream again and again using custom solution, I started to wonder why we don't have a solution in boost. Does it makes sense to include operators<< for vectors, sets, etc? I was thinking abou