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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:56:57+00:00 2026-06-17T07:56:57+00:00

I have a problem with boost::program_options i have a class namespace po = boost::program_options;

  • 0

I have a problem with boost::program_options

i have a class

namespace po = boost::program_options;
class imageProcess{
private:
    po::options_description options;
public:
    imageProcess(int argc,char** argv){
        po::options_description desc("Allowed options");
        this->options = desc;

It gives me these errors:

non-static const member ‘const unsigned int
boost::program_options::options_description::m_min_description_length’,
can’t use default assignment operator imgproc line 163, external
location:
/usr/include/boost/program_options/options_description.hpp C/C++
Problem non-static const member ‘const unsigned int
boost::program_options::options_description::m_line_length’, can’t use
default assignment operator imgproc line 163, external location:
/usr/include/boost/program_options/options_description.hpp C/C++
Problem use of deleted function
‘boost::program_options::options_description&
boost::program_options::options_description::operator=(const
boost::program_options::options_description&)’ imageProcess.cpp /imgproc/src line
20 C/C++ Problem

What should i do to make options field instance of po::options_description?

EDIT:
I know options field is already an instance but is there a way to set the description “Allowed options” after defining this field(po::options_description options(“allowed options”); doesnt work too)? And how i should store previously created instances of object into class fields?

  • 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-17T07:56:58+00:00Added an answer on June 17, 2026 at 7:56 am

    Read your errors:

    non-static const member ‘const unsigned int boost::program_options::options_description::m_min_description_length’, can’t use default assignment operator

    non-static const member ‘const unsigned int boost::program_options::options_description::m_line_length’, can’t use default assignment operator

    use of deleted function ‘boost::program_options::options_description& boost::program_options::options_description::operator=(const boost::program_options::options_description&)’

    They indicate that boost::program_options::options_description does not support the assignment operator operator= in your version of Boost (actually since v1.33), due to the const member within options_description.

    You’ll have to — and anyway should — initialise your options_description instance using the ctor-initializer:

    namespace po = boost::program_options;
    class imageProcess{
    private:
        po::options_description options;
    public:
        imageProcess(int argc, char** argv);
    };
    
    imageProcess::imageProcess(int argc, char** argv)
       : options("Allowed options")
    {}
    

    The line starting : is where your constructor arguments for the member options go.

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

Sidebar

Related Questions

i have a class that has this function: typedef boost::shared_ptr<PrimShapeBase> sp_PrimShapeBase; class Control{ public:
I have a problem getting boost::multi_index_container work with random-access and with orderd_unique at the
I'm new in using boost and have a problem. I need shared_mutex function in
I have a problem using boost serialization using binary archives. It works when using
I have a problem with the following code: #include <boost/thread/thread.hpp> #include <boost/thread/mutex.hpp> #include <iostream>
I am using boost::program_options and want to pass domain-like options to my program. Such
I have some trouble reading from an ini file using boost program options. The
I'm using boost regex_match and I have a problem with matching no tab characters.
I have a problem with a boost::asio::ip::tcp::iostream. I am trying to send about 20
I have problem with boost library, when i try compilling simple program g++ show

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.