Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7952 Discussions

19.1 compiler incomplete type is not allowed

AndrewC
New Contributor III
1,439 Views

I am trying to use the useful C++ header library from GitHub

https://github.com/taocpp/operators

This sample code compiles with Visual Studio 2019 16.7 compilers, but Intel 19.1 fails with "incomplete type is not allowed". Any suggestions for getting this to compile. I am using C++17 language.

#include <tao/operators.hpp>

class MyInt
  : tao::operators::commutative_addable< MyInt >,
    tao::operators::multipliable< MyInt, double >
{
public:
  // create a new instance of MyInt
  MyInt( const int v ) noexcept;

  // copy and move constructor
  MyInt( const MyInt& v ) noexcept;
  MyInt( MyInt&& v ) noexcept; // optional

  // copy and move assignment
  MyInt& operator=( const MyInt& v ) noexcept;
  MyInt& operator=( MyInt&& v ) noexcept; // optional

  // addition of another MyInt
  MyInt& operator+=( const MyInt& v ) noexcept;
  MyInt& operator+=( MyInt&& v ) noexcept; // optional

  // multiplication by a scalar
  MyInt& operator*=( const double v ) noexcept;
};

 

0 Kudos
5 Replies
Gopika_Intel
Moderator
1,408 Views

Hi,

 

Thank you for posting in Intel C++ Compiler forum. Sorry for the delay in response. We were able to reproduce the issue. We’ll get back to you about the possible explanation of the error.

 

Regards

Gopika


0 Kudos
Gopika_Intel
Moderator
1,395 Views

Hi,


We're forwarding this case to the internal team who can help you out.


Regards

Gopika


0 Kudos
Viet_H_Intel
Moderator
1,385 Views

I've submitted this issue to our Developer. Will keep you updated.

Thanks


0 Kudos
Milos9304
Beginner
1,268 Views

I've had the same problem. Solved as suggested in https://github.com/taocpp/operators by

#include <utility> // make sure it's included before the following!
#define noexcept(...)
// you probably also need this for older compilers:
#define TAO_OPERATORS_CONSTEXPR
#include <tao/operators.hpp>
#undef noexcept

perhaps that provides some insight

0 Kudos
Viet_H_Intel
Moderator
1,092 Views

Hi,

The version against which you reported your issue is no longer targeted for fixes. Please check out the new versions of Intel oneAPI Toolkits for the latest features.

Workaround with icpc is to remove the noexcept expression.

I am going to close this thread. If you have any questions/concerns please open a new thread.


Thanks,




0 Kudos
Reply