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 8381949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:48:45+00:00 2026-06-09T16:48:45+00:00

I have a program (trimmed way down) that compiles and runs as I think

  • 0

I have a program (trimmed way down) that compiles and runs as I think it should, yet in the code window an asterisk (operator*) has a red squiggle under it and the mouse-over caption says, ‘Error, no operator * matches these operands.’ I guess the squiggly line neglected to tell the compiler. The same thing happens if I change operator* to a function named “dot”.

If there are few enough hoops to jump through, I would like to report it to MS. But first, tell me if the compiler and I are wrong, and the squiggle is right.

#include <vector>
#include <iostream>
//#include "fp_vectors.h"
// Header file =================
#include <type_traits>
#include <algorithm>

namespace dj {

    // Dot-product of two real-valued vectors
    template <typename FirstType, typename SecondType> 
    auto operator*(const FirstType &a, const SecondType &b) -> decltype(a[0]*b[0]){
       std::remove_const<decltype(a[0]*b[0])>::type ret = 0.0;
       const int sz = std::min(a.size(),b.size());
       for(int i=0;i<sz;++i) {
           ret += a[i]*b[i];
       }
       return ret;
    }


} // namespace dj

// End header file ================


using namespace std;
typedef vector<float> fvec;
typedef vector<double> dvec;

using namespace dj;

int main()
{
    const size_t sz = 3;
    fvec fv(sz);
    dvec dv(sz);
    for(size_t i=0; i<sz; ++i) {
        fv[i] = -.89f*(i-1.0f);
        dv[i] = 1.6*(i-2.2);
    }
    double ret = dv*fv; // Earns a red squiggly
    cout << ret << endl;
    return 0;
}
  • 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-06-09T16:48:47+00:00Added an answer on June 9, 2026 at 4:48 pm

    Bugs in Visual Studio may be reported on Microsoft Connect.

    However, I took a brief look at your code, and there are no squiggles in Visual Studio 2012. So, if there was a bug here, it looks like it’s been fixed.

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

Sidebar

Related Questions

I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of
I have program that runs for long periods of time and I'd like to
I have program that requires Python 3, but I develop Django and it uses
I have program, that must interact with a console program before my program can
I have a program that gets a JSON from the server using getJSON and
I have a program that saves an image in a local directory and then
I have program in Java that I want to rewrite (GUI and some new
i have program which prints all char from char_min to char_max here is code
My program have several worker threads that calling a function in a dynamically loaded

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.