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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:00:21+00:00 2026-05-31T15:00:21+00:00

I have a 20-30 line C++ function which was taking a reference to an

  • 0

I have a 20-30 line C++ function which was taking a reference to an int for possible updation. Now I am replacing the member which was passed to it with a member of a member encapsulating more data, something like:

searchState.matchedOK = specificSearch(*pageIndices.GetStringIByRef(), searchState); //new, and overwritten.
searchState.matchedOK = specificSearch(pageOffsetInText, searchState); //old

I want to localise this modification to the lines and function called above because the old member should be removed once I have verified equivalence and beyond.

Is this possible with simple casts?

If you want code:

static bool specificSearch(int &matchLocation, const SearchSpecs &specs) {/**/}

and the recently added member:

inline unsigned int *GetStringIByRef() {return &stringI;}
  • 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-31T15:00:22+00:00Added an answer on May 31, 2026 at 3:00 pm

    I’m not 100% sure I understand your question, so I might completely miss the mark here. But if you make your function a template:

    template<typename IntType>
    static bool specificSearch(IntType &matchLocation, const SearchSpecs &specs) {/**/}
    

    That will allow you to pass either type to it.

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

Sidebar

Related Questions

I have a simple question related to one-line programming. First an example: function test(a)
I currently have a huge HTML file which doesn't have line breaks and just
I'm taking some information from some variables I have already defined outside this function
Let's say I want to have a function which reads data from the SerialPort
I have a function that's taking a long time to run. When I profile
I have a function which returns mouse event positions. // returns the xy point
I have a function which shall return a char*. Since I have to concatenate
I have an oracle function which is given below. when I run this in
I have this function which writes content to a text file: function write($text){ fwrite($this->fp,
I have a function which uses MSXML to post an XML document which yesterday

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.