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

  • SEARCH
  • Home
  • 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 8349135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:54:18+00:00 2026-06-09T07:54:18+00:00

So I have a generic Matrix class that I created which has the following

  • 0

So I have a generic Matrix class that I created which has the following operator overload:

class Matrix
{
public:
    Matrix() {}
    Matrix(int i, int j, int k) {}
    Matrix operator*(const Matrix &right)
    {
    }
};

I also have a Matrix2 class that inherits from my Matrix class.

class Matrix2 : public Matrix
{
};

When I try to multiply two Matrix2 objects together I get a compiler error stating:

‘there is no operator found which takes a left hand operand of type Matrix2 (or there is no accessible conversion)’

Why is this and how can I properly implement operator overloads with inheritance?

EDIT:

As pointed out my problem was partially because of the “most vexing parse”. Now my problem, I believe, strictly has to do with the operator overload and inheritance.

I can multiply two Matrix objects just fine, but I cannot multiply two Matrix2 objects together.

Matrix2 i;
Matrix2 m;
Matrix result = m * i;

The error message:

error C2678: binary '*' : no operator found which takes a left-hand operand of type 'Matrix2' (or there is no acceptable conversion).

  • 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-09T07:54:21+00:00Added an answer on June 9, 2026 at 7:54 am

    You are biting the Most Vexing Parse. It is a syntactic error leading to the declaration of functions rather than objects.

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

Sidebar

Related Questions

I have generic type that looks like: public class GenericClass<T, U> where T :
I have a Generic Base Class that I want to allow one of two
I have generic async task class which fetches response from server . And i
I have a generic base repository class for LINQ-to-Entities that can do things like
We have an application that stores a sparse matrix. This matrix has entries that
I have a function in a generic class that calculates a determinant of a
I have a generic Vector<T> class and a generic Matrix<T> class and I was
I have generic list which must be a preserved order so I can retrieve
I want to write in Delphi (2009 - so I have generic dictionary class)
Is there any name for the following DB table design: Basically we have generic

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.