Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 717267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:23:39+00:00 2026-05-14T05:23:39+00:00

I currently use C for numerical computations. I’ve heard that using C++ Expression Templates

  • 0

I currently use C for numerical computations. I’ve heard that using C++ Expression Templates is better for scientific computing. What are C++ Expression Templates in simple terms?

  1. Are there books around that discuss numerical methods/computations using C++ Expression Templates?

  2. In what way, C++ Expression Templates are better than using pure C?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:23:39+00:00Added an answer on May 14, 2026 at 5:23 am

    What are C++ Expression Templates in simple terms?

    Expression templates are a category of C++ template meta programming which delays evaluation of subexpressions until the full expression is known, so that optimizations (especially the elimination of temporaries) can be applied.

    Are there books around that discuss numerical methods/computations using C++ Expression Templates?

    I believe ET’s were invented by Todd Veldhuizen who published a paper on it 15 years ago. (It seems that many older links to it are dead by now, but currently here is a version of it.) Some material about it is in David Vandevoorde’s and Nicolai Josuttis’ C++ Templates: The Complete Guide.

    In what way, C++ Expression Templates are better than using pure C?

    They allow you to write your code in an expressive high level way without losing performance. For example,

    void f(const my_array<double> a1, const my_array<double> a2) 
    { 
      my_array<double> a3 = 1.2 * a1 + a1 * a2; 
      // ..
    }
    

    can be optimized all the way down to

    for( my_array<double>::size_type idx=0; idx<a1.size(); ++idx ) 
      a3[idx] = 1.2*a1[idx] + a1[idx]*a2[idx]; 
    

    which is faster, but harder to understand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer App Engine can and will unload applications that are idle… May 15, 2026 at 10:43 pm
  • Editorial Team
    Editorial Team added an answer Just use 0.0.0.0/0. host all all 0.0.0.0/0 md5 Make sure… May 15, 2026 at 10:43 pm
  • Editorial Team
    Editorial Team added an answer One possibility would be to use CFMutableSet. When you create… May 15, 2026 at 10:43 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.