Any Generic ET framework?

Discussion in 'C++' started by Ben, Jul 6, 2004.

  1. Ben

    Ben Guest

    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.
     
    Ben, Jul 6, 2004
    #1
    1. Advertising

  2. "Ben" <> wrote in message
    news:...
    > 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
     
    Jonathan Turkanis, Jul 6, 2004
    #2
    1. Advertising

  3. Ben

    tom_usenet Guest

    On 5 Jul 2004 23:26:33 -0700, (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
     
    tom_usenet, Jul 6, 2004
    #3
  4. 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
     
    Thomas Matthews, Jul 6, 2004
    #4
  5. Ben

    Ben Guest

    >
    > 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. :->
     
    Ben, Jul 6, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kikoz
    Replies:
    6
    Views:
    407
    Indentix, Inc.
    Jul 27, 2004
  2. Murat Tasan
    Replies:
    1
    Views:
    8,120
    Chaitanya
    Feb 3, 2009
  3. Replies:
    2
    Views:
    473
  4. Anthony Hilario
    Replies:
    0
    Views:
    319
    Anthony Hilario
    Jun 22, 2006
  5. minlearn
    Replies:
    2
    Views:
    485
    red floyd
    Mar 13, 2009
Loading...

Share This Page