Jump to content

Weird Shared Pointer Errors


Josh
 Share

Recommended Posts

I'm down to just 12 errors before I can compile the very first build of of Leadwerks version 500!  These errors seem to be related to shared pointers but I can't see where in the code they are actually being cast to pointers or whatever.

Image1.jpg.87892b8139ce480c3714f92f3c4507c5.jpg

All the errors point to the built-in memory and xutility CPP files, which say things like this:
 

	// TEMPLATE CLASS _Ref_count_obj
template<class _Ty>
	class _Ref_count_obj
	: public _Ref_count_base
	{	// handle reference counting for object in control block, no allocator
public:
	template<class... _Types>
		_Ref_count_obj(_Types&&... _Args)
		: _Ref_count_base()
		{	// construct from argument list
		::new ((void *)&_Storage) _Ty(_STD forward<_Types>(_Args)...);
		}

This is not very clear and I don't know how to resolve these errors.  Any ideas?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I never liked the "Error list" window, what's in the "Output" window regarding these errors? What does the line of code in Leadwerks that is causing the error look like?

It seems like these errors don't all have the same cause. I am able to to reproduce the 6th error like this:

std::shared_ptr<Point> blah;
std::shared_ptr<Triangle> blah2;

blah = blah2;

Which is pretty obvious what's wrong there. The error given is:

1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): error C2440: '<function-style-cast>': cannot convert from 'const std::shared_ptr<Triangle>' to 'std::shared_ptr<Point>'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>  C:\Junk\Src\Thing.cpp(155): note: see reference to function template instantiation 'std::shared_ptr<Point> &std::shared_ptr<Point>::operator =<Triangle>(const std::shared_ptr<Triangle> &) noexcept' being compiled
1>  C:\Junk\Src\Thing.cpp(155): note: see reference to function template instantiation 'std::shared_ptr<Point> &std::shared_ptr<Point>::operator =<Triangle>(const std::shared_ptr<Triangle> &) noexcept' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): error C2228: left of '.swap' must have class/struct/union

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...