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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:42:24+00:00 2026-05-26T16:42:24+00:00

I wish to parse a string and ensure that it is lower case. It

  • 0

I wish to parse a string and ensure that it is lower case.

It has to be done at this stage because spirit builds tree out of it all.

so I have this rule

struct to_lower_object
{
    typedef char result_type;

    char operator()(char a) const
    {   
        return std::tolower(a);    
    }   
};


int main()
{

boost::phoenix::function<to_lower_object> lazy_lower;

qi::rule<std::string::iterator, char() >
    lower_char=(qi::char_-":")
    [
         qi::_val=lazy_lower(qi::_1);
    ];

qi::rule<std::string::iterator, std::string() >
    lower_string =
        +lower_char; 
:::

problem is that it doesn’t compile, the error is massive also, to big to post.

Thanks

EDIT: I fixed the operator overload, that was my bad, but the problem persists. I beleive* it is to do with the placeholders

EDIT2: I have split the problem up to ensure that it is working on a char and not a series of them, but it still isn’t working with the same reams of errors.

  • 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-05-26T16:42:25+00:00Added an answer on May 26, 2026 at 4:42 pm

    Well after much torment I finally got it working.

    This:

    struct to_lower_object
    {
        typedef char result_type;
    
        char operator()(char a) const
        {   
            return std::tolower(a);    
        }   
    };
    

    Should have been:

    struct to_lower_object
    {
        template<typename Arg>
        struct result{
            typedef char type;
        };  
    
        template<typename Arg>
        char operator()(Arg arg1) const
        {   
            return std::tolower(a);    
        }   
    };
    

    Super. This apparently is because I was reading some old docs.

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

Sidebar

Related Questions

I wish to define a type String such that declaring a variable of type
I am receiving a string via query string and I wish to add this
I have an interface with something like 20 textboxes that I wish to parse
I wish Subversion had a better way of moving tags. The only way that
I wish to implement my software on a shareware basis, so that the user
I wish to test a function that will generate lorem ipsum text, but it
My wish is to know how I can program a mobile website, that fit
I have an existing system that I do not wish to change where I
I have the following collection ( see image ) . I wish to parse
I'm tearing my hair off my head on this one. Trying to parse this

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.