Any Generic ET framework?

B

Ben

Hi,

I was writing a expression template for string concatenation latetly.

When writing it, I started to feel curious that why there's not any
generic et lib that can save me from wring each different et lib from
scratch. Or, maybe I was just ignorant and there is some already?

matrix, string, array, vector, whatever, the idea of et is quite
similar. We need a leaf node and a binary non-leaf node for expressing
the expression syntax tree; We need to overload some operators; We
need to broadcast certain functor object recursively to all leaf
nodes, etc.
And there can be many generic tasks that are not specific to matrix or
string at all. (say, find out how many leaf nodes in the tree, or find
out the type of or reference to the #i leaf node, etc.)

And we shouldn't be writing such kind of code over and over again for
different things that we want to make lazy, should we?

So, I started writing my own generic et framework. And using this
framework, I have created my string concatenation for string, const
char*, const char[k], CString. They can even be mixed.
Each different type just needs to specialize a few classes to use this
framework.

Code using this framework can look like:
string str = "world";
CString cstr = "...";
string s = et + "hello" + " " + str + cstr + "!";


But before I start writing my next et, (I'm thinking about using it to
apply MCM algorithm for matrixes), I want to make sure that I'm not
doing anything that has been done well in another lib.

So, the question is: is there anything out there that has already does
so?

Can I simply customize an existing generic et lib to optimize my
string concatenation for string, CString, MyString etc?


Ben.
 
J

Jonathan Turkanis

Ben said:
Hi,

I was writing a expression template for string concatenation latetly.

When writing it, I started to feel curious that why there's not any
generic et lib that can save me from wring each different et lib from
scratch. Or, maybe I was just ignorant and there is some already?

There is Daixtrose: http://daixtrose.sourceforge.net/.

I can't say whether it is any good, but you might want to check it
out. Markus Werle has talked about submitting it to boost.

Jonathan
 
T

tom_usenet

Hi,

I was writing a expression template for string concatenation latetly.

When writing it, I started to feel curious that why there's not any
generic et lib that can save me from wring each different et lib from
scratch. Or, maybe I was just ignorant and there is some already?

There are several of them!

http://daixtrose.sourceforge.net/ (which sounds like a sugar)

This was the first one I think, from many years back:
http://acts.nersc.gov/pete/ (which sounds like a mate down the pub)

Tom
 
T

Thomas Matthews

Ben said:
Hi,

I was writing a expression template for string concatenation latetly.

When writing it, I started to feel curious that why there's not any
generic et lib that can save me from wring each different et lib from
scratch. Or, maybe I was just ignorant and there is some already?
What is ET an abbreviation for?

[snip]
But before I start writing my next et, (I'm thinking about using it to
apply MCM algorithm for matrixes), I want to make sure that I'm not
doing anything that has been done well in another lib.
What is MCM?

[snip]

When posting to an international newsgroup that has a wide audience,
please either refrain from the abbreviations or define them before
you use them, such as:
I need help with Binary Tree Search (BTS) algorithm....

Don't assume any knowledge, except standard C++, from your
target audience in this newsgroup.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
B

Ben

When posting to an international newsgroup that has a wide audience,
please either refrain from the abbreviations or define them before
you use them, such as:
I need help with Binary Tree Search (BTS) algorithm....

Don't assume any knowledge, except standard C++, from your
target audience in this newsgroup.
Sorry for that.
ET stands for "expression template".

MCM stands for "Matrix-chain multiplication". I was trying to give the
full name for this, it is just that I forgot the full name when
posting. :->
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top