By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

Any Generic ET framework?

P: n/a
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.
Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"Ben" <be****@combined.com> wrote in message
news:24**************************@posting.google.c om...
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
Jul 22 '05 #2

P: n/a
On 5 Jul 2004 23:26:33 -0700, be****@combined.com (Ben) wrote:
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
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Jul 22 '05 #3

P: n/a
Ben wrote:
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]


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.

--
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

Jul 22 '05 #4

P: n/a
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. :->
Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.