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

The Archive Base Latest Questions

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

Well in my program i have made a class of name ‘Transition’. When i

  • 0

Well in my program i have made a class of name ‘Transition’.
When i made a vector of Transition type named delta_.
And when later in one of my functions implementation of the class where i have declared delta_, i tried to use iterator with the syntax given below:

vector<Transition>::iterator it;
it=this->delta_.begin();

i got these two errors:

In constructor `__gnu_cxx::__normal_iterator<_Iterator, Container>::_normal_iterator(const __gnu_cxx::__normal_iterator<_Iter, _Container>&) [with _Iter = const Fa::Transition*, _Iterator = Fa::Transition*, _Container = std::vector >]’:

invalid conversion from const Fa::Transition* const' toFa::Transition*’

Now i really have no idea where the mistake is. Can anybody please help!!

  • 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-31T11:04:22+00:00Added an answer on May 31, 2026 at 11:04 am

    Let me guess, are you doing it=this->delta_.begin(); in a const method of the class, and delta_ is a member of the class?

    A constness of the method guarantees that members of the class will not changed. But the variable it has non-const type iterator, and that gives possibility to change the member delta_ which makes the protection corrupt.

    The std::vector has two overloaded methods begin()

    iterator begin ();
    const_iterator begin () const;
    

    If you use begin() in a method which is const, compiler calls second one.

    So you need to refuse from constness of the method, or use const_iterator.

    Another possible way, which I do not recommend because of blurring constness of the object, is to put your vector on a heap and operate with a pointer to it.

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

Sidebar

Related Questions

I have made a simple program with : working with files(read write) end class
i have a program made in flash who runs well, the actions on the
I have used ajax auto completeextender in my program well its works fine no
We have a Perl program that ran well on all Windows platforms so far.
I have a popup function in a program that works well, be re-loads the
Well, i have written a simple python program that parses HTML with HTMLParser. Here
I have a client program that consumes a web service. It works quite well
I have a problem with debugging sessions. My program executes very well in a
i have made a program in vc++ 2010 in win7 but since the submission
I have made a program in C# 2010 and my code contains a Tuple,

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.