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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:41:34+00:00 2026-06-10T12:41:34+00:00

Compiler: MSVS 2008 Boost: 1.49 Code: #include <boost/signals2.hpp> #include <boost/thread.hpp> class SigOwner { public:

  • 0

Compiler: MSVS 2008

Boost: 1.49

Code:

#include <boost/signals2.hpp>
#include <boost/thread.hpp>

class SigOwner
{
public:
    typedef boost::signals2::signal<void (int)> OSig;
    OSig _signal;

    void doConnect(OSig::slot_type slot) { _signal.connect(slot); }
};

class SigUser
{
public:
#if defined(FAIL2)
    boost::mutex sync;
#endif
#if defined(FAIL1)
    boost::condition_variable evSig;
#endif

    void setup(SigOwner &so)
    {
        so.doConnect(*this);   // failure 1 traces back to this line
    }

    void operator()(int value) // signature to make SigUser a slot
    {
    }
};                             // failure 2 flags on this line

As presented, this compiles OK.

If I define FAIL1 (with or without FAIL2), a compiler error occurs within signals2/slot_template.hpp:
error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘const SigUser’ (or there is no acceptable conversion)

I don’t know why the *this is being considered const.

If I define FAIL2 (without defining FAIL1) a compiler error occurs at the indicated line:
error C2248: ‘boost::mutex::mutex’ : cannot access private member declared in class ‘boost::mutex’

I don’t know what private member is trying to be accessed.

Can anyone provide me a clue? Preferably a clue that allows me to define both FAIL1 and FAIL2 and get a successful compilation.

  • 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-10T12:41:36+00:00Added an answer on June 10, 2026 at 12:41 pm

    Neither mutex nor condition_variable are copiable, so your SigUser is not copiable, so you cannot pass it to doConnect this way. One way to work-around this is to define sync and evSig as (smart)pointers.

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

Sidebar

Related Questions

My problem is MSVS 2010 C++ compiler is generating code in a way after
The compiler complains about this code: HashMap<String,int> userName2ind = new HashMap<String,int>(); for (int i=0;
The compiler is not recognizing my object heatingUnit as a type of the class
When compiler need to know the size of a C (class) object: For example,
In MSVS when I #include <someHeader> it is searched in a different folder than
Is it ok to write code in an MSVS that does not have commerical
I get a compiler error (C2061) in MSVS C++ 2010 IDE, when I try
While the Microsoft compiler typically builds faster code, I'm in an environment where building
I am fairly new to developing C/C++ code in MSVS but one of the
My compiler (VC++ 6.0 sp6) has apparently gone insane. In certain pieces of code

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.