Cinder::signals::communication cannot be assigned

Hi All,

Trying to run an on a project that was originally developed for 0.9.0. I’m working off of the current master branch. I cloned the repo and built using xcode, which threw the following error:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1751:19: Object of type ‘cinder::signals::Connection’ cannot be assigned because its copy assignment operator is implicitly deleted

I’ve never run into this before so am at a bit of a loss as to the solution. I’ve read the other forum posts RE boost and cinder::signals, but now sure if/how my problem is related. Any advice would be appreciated.

Thanks,

Craig

Hey there,

Can you post the code that causes the build error? It should be further down in that compiler error message.

Hey Rich,

Full compilier error message:

/Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/ImGui/src/CinderImGui.cpp:1:1: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/ImGui/src/CinderImGui.cpp:1:
/Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/SketchCNC_Prefix.pch:4:11: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/SketchCNC_Prefix.pch:4:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/app/App.h:29:11: In file included from …/…/…/Cinder/include/cinder/app/App.h:29:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/app/cocoa/AppMac.h:26:10: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/…/…/…/Cinder/include/cinder/app/cocoa/AppMac.h:26:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/app/AppBase.h:28:10: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/…/…/…/Cinder/include/cinder/app/AppBase.h:28:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/app/Platform.h:26:10: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/…/…/…/Cinder/include/cinder/app/Platform.h:26:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/DataSource.h:28:10: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/…/…/…/Cinder/include/cinder/DataSource.h:28:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/Url.h:26:10: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/…/…/…/Cinder/include/cinder/Url.h:26:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/Stream.h:27:10: In file included from /Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/…/…/…/Cinder/include/cinder/Stream.h:27:
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/Exception.h:26:10: In file included from …/…/…/Cinder/include/cinder/Exception.h:26:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:439:10: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/string:439:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1775:19: In instantiation of function template specialization ‘std::__1::__copy<const cinder::signals::Connection *, cinder::signals::Connection *>’ requested here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1404:30: In instantiation of function template specialization ‘std::__1::copy<const cinder::signals::Connection *, cinder::signals::Connection *>’ requested here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:584:10: In instantiation of function template specialization ‘std::__1::vector<cinder::signals::Connection, std::__1::allocatorcinder::signals::Connection >::assign<const cinder::signals::Connection *>’ requested here
/Users/Craig/Documents/cinder_dev/myProjects/SketchCNC/xcode/ImGui/src/CinderImGui.cpp:996:21: In instantiation of member function ‘std::__1::vector<cinder::signals::Connection, std::__1::allocatorcinder::signals::Connection >::operator=’ requested here
/Users/Craig/Documents/cinder_dev/Cinder/include/cinder/Signals.h:124:2: Copy assignment operator is implicitly deleted because ‘Connection’ has a user-declared move constructor

and here’s the code from the algorithm file:

template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
    for (; __first != __last; ++__first, (void) ++__result)
        *__result = *__first;
    return __result;
}

and from the CinderImgui.cpp file:

void connectWindow( ci::app::WindowRef window )
{
	sWindowConnections = {
		window->getSignalMouseDown().connect( mouseDown ),
		window->getSignalMouseUp().connect( mouseUp ),
		window->getSignalMouseDrag().connect( mouseDrag ),
		window->getSignalMouseMove().connect( mouseMove ),
		window->getSignalMouseWheel().connect( mouseWheel ),
		window->getSignalKeyDown().connect( keyDown ),
		window->getSignalKeyUp().connect( keyUp ),
		window->getSignalResize().connect( resize ),
	};
}

Hey,

you are missing this PR probably https://github.com/simongeilfus/Cinder-ImGui/pull/31

Cheers,
Petros

you are missing this PR probably https://github.com/simongeilfus/Cinder-ImGui/pull/314

I had only just noticed that (don’t use ImGui myself), wrote a comment there that possibly we need to address something in ci::signals::Connection?

Hey Petros and Rich,

Using Simon’s fork of ImGui solved the problem. I’d like to try and understand a little more what was going on / what the problem is. I’ve been digging through the cinder::signals code to try and get a better idea, but any other resources would be welcomed.

Thanks again for the help,

Craig

Just noticed this effects some other blocks that use Signals too (Cinder-UiTree for example).

Might be worth adding a note to the next RFC about the work on the master branch that people may need to update their blocks to work in the future.