Re: boost::any

2003-10-08 Thread Andre Poenitz
On Wed, Oct 08, 2003 at 02:55:37PM +, Angus Leeming wrote: > Andre Poenitz wrote: > > Is that to be expected? > > Here I have > $ sed -n '175p' boost/boost/any.hpp > throw_exception(bad_any_cast()); > > I think that you should 'cvs -q up boost' and the problem will be > resolved.

Re: boost::any

2003-10-08 Thread Angus Leeming
Andre Poenitz wrote: > Is that to be expected? Here I have $ sed -n '175p' boost/boost/any.hpp throw_exception(bad_any_cast()); I think that you should 'cvs -q up boost' and the problem will be resolved. -- Angus

Re: boost::any

2003-10-08 Thread Lars Gullik Bjønnes
devel/boost/boost/any.hpp: In function `ValueType | boost::any_cast(const boost::any&) [with ValueType = |lyx::external::RotationCommandFactory]': | ../../../lyx-devel/src/insets/ExternalTransforms.C:319: instantiated | from `void lyx::externalextractIt(const boost::any&,

boost::any

2003-10-08 Thread Andre Poenitz
el/src/insets/../ -I../../../lyx-devel/boost -I/usr/X11R6/include -O -fno-exceptions -W -Wall -c ../../../lyx-devel/src/insets/ExternalTransforms.C -MT ExternalTransforms.lo -MD -MP -MF .deps/ExternalTransforms.TPlo ../../../lyx-devel/boost/boost/any.hpp: In function `ValueType boost::any_cast(cons

Re: [patch]: boost any

2003-10-07 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | Angus Leeming wrote: >> Lars, could I get you to apply this/contact the boost list as you >> see fit? > | Thanks for doing that Lars. I see that the change has been committed | and have noted the comment about including the appropriate header. > | I'll

Re: [patch]: boost any

2003-10-07 Thread Angus Leeming
Angus Leeming wrote: > Lars, could I get you to apply this/contact the boost list as you > see fit? Thanks for doing that Lars. I see that the change has been committed and have noted the comment about including the appropriate header. I'll commit the changes to the lyx tree. -- Angus

[patch]: boost any

2003-10-06 Thread Angus Leeming
As discussed. Lars, could I get you to apply this/contact the boost list as you see fit? I note that there are a total of 34 throws in the boost libs $ grep -r 'throw ' boost | grep -c -v ChangeLog -- AngusIndex: boost/ChangeLog =

Re: Using boost::any

2003-10-02 Thread Angus Leeming
Lars Gullik Bjønnes wrote: > But aren't you using the wrong any_cast here? > Shouldn't you use boost::any_cast? I would love to, but that would mean storing a pointer to a boost::function. > Hmm... there is something I do not understand here. any_cast with a > refernece or a value type will thro

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
nks, Lars. >> >> Next iteration. I think that this is ready to convert into InsetExternal >> code. > | Hmmppfff! trying to do so, I get this > | ../../../boost/boost/any.hpp: In function `ValueType boost::any_cast(const |boost::any&) [with ValueType = lyx::external:

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
nks, Lars. >> >> Next iteration. I think that this is ready to convert into InsetExternal >> code. > | Hmmppfff! trying to do so, I get this > | ../../../boost/boost/any.hpp: In function `ValueType boost::any_cast(const |boost::any&) [with ValueType = lyx::external:

Re: Using boost::any

2003-10-02 Thread Angus Leeming
InsetExternal > code. Hmmppfff! trying to do so, I get this ../../../boost/boost/any.hpp: In function `ValueType boost::any_cast(const boost::any&) [with ValueType = lyx::external::RotationCommandFactory]': ../../../src/insets/ExternalTemplate.h:54: instantiated from `void ly

Re: Using boost::any

2003-10-02 Thread Angus Leeming
transformer holds a copy of the data it is to transform. I couldn't make the thing stateless before because I needed the front(), back() member functions to have the same signature. Now that you have shown me how to use boost::any that could change. string const RotationLatexComma

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
ics. ok | I can do that by storing the factory functions that generate the | transformers available to a particular output target in a vector | 'somehow'. The problem is the 'somehow'. The different factory functions | have different signatures, taking RotationData, ResizeData etc. very well. | This is where boost::any comes to the rescue. right. -- Lgb

Re: Using boost::any

2003-10-02 Thread Angus Leeming
which alters the primary command itself, as for \includegraphics. I can do that by storing the factory functions that generate the transformers available to a particular output target in a vector 'somehow'. The problem is the 'somehow'. The different factory functions have different signatures, taking RotationData, ResizeData etc. This is where boost::any comes to the rescue. -- Angus

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | Angus Leeming wrote: >> Lars Gullik Bjxnnes wrote: >>> note the member function boost::any:type >> >> Bingo! No need for exceptions after all. >> Many thanks, Lars. > | Next iteration. I think that this is ready to convert into InsetExternal | code. Ho

Re: Using boost::any

2003-10-02 Thread Angus Leeming
sizeLatexOption : public TransformOption { static ptr_type factory(ResizeData const & data); private: ResizeLatexOption(ResizeData const & data_) : data(data_) {} virtual string const option() const; ResizeData data; }; struct TransformStore { TransformStore() {} template TransformS

Re: Using boost::any

2003-10-02 Thread Angus Leeming
Lars Gullik Bjønnes wrote: > Angus Leeming <[EMAIL PROTECTED]> writes: > > | Attached is a simple sample showing how I could use boost::any to > | implement the transformation stuff in InsetExternal. > > I do not agree with how you use operatesOn. Thanks for the feed

Re: Using boost::any

2003-10-02 Thread Angus Leeming
Lars Gullik Bjønnes wrote: > note the member function boost::any:type Bingo! No need for exceptions after all. Many thanks, Lars. -- Angus

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Thu, Oct 02, 2003 at 12:48:16PM +0200, Lars Gullik Bjønnes wrote: >> If we all agree that we want to use exceptions, I am all for it. >> But that is up to the rest of you. > | What's the drawback? To use excepitions well is not easy, and it has to be

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | Attached is a simple sample showing how I could use boost::any to implement | the transformation stuff in InsetExternal. > | I think it results in very elegant code, but the killer is the try,catch | block. The block is needed, so I guess

Re: Using boost::any

2003-10-02 Thread Andre Poenitz
On Thu, Oct 02, 2003 at 12:48:16PM +0200, Lars Gullik Bjønnes wrote: > If we all agree that we want to use exceptions, I am all for it. > But that is up to the rest of you. What's the drawback? I.e. which of the currently supported compilers don't 'do' exceptions? [I am fine with them btw.] And

Re: Using boost::any

2003-10-02 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | Attached is a simple sample showing how I could use boost::any to implement | the transformation stuff in InsetExternal. I do not agree with how you use operatesOn. | template | TransformCommand::ptr_type | getTransforme

Using boost::any

2003-10-02 Thread Angus Leeming
Attached is a simple sample showing how I could use boost::any to implement the transformation stuff in InsetExternal. I think it results in very elegant code, but the killer is the try,catch block. The block is needed, so I guess that this means I cannot use the appropach within lyx? Shame