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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:47:06+00:00 2026-06-09T00:47:06+00:00

Hey guys I’m having trouble with some code I’m writing for a .obj model

  • 0

Hey guys I’m having trouble with some code I’m writing for a .obj model parser.
Here’s the code that’s causing the problem:

std::istringstream iss(line.substr(1));

std::copy(   
std::istream_iterator<float>(iss),     
std::istream_iterator<float>(),    
std::back_inserter<std::vector<float>>(model.chunks.back().vectices)  
);

It’s basically taking a string passed as a argument like this:

v -5.000000 -1.000000 1.000000

Then gets the substring from it so it’s left with only this:

-5.000000 -1.000000 1.000000

Finally I use std::copy and get each set of numbers from within the string:

vertices[0] = -5.000000
vertices[1] = -1.000000
vertices[2] = 1.000000

Anyways the main problem here is that I’m getting an error from this line of code:

std::back_inserter<std::vector<float>>(model.chunks.back().vectices));

It says “expected token ‘;’ got float” my code still compiles and run’s flawlessly though.

Although if I replace the floats in that code with std::string’s I don’t get the error anymore.

std::copy(  
std::istream_iterator<std::string>(iss),   
std::istream_iterator<std::string>(),   
std::back_inserter<std::vector<std::string>>(model.chunks.back().vectices)  
);

I’m using Qt Creator so could this possibly be just a IDE error? Any help would be greatly appreciated!

  • 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-09T00:47:07+00:00Added an answer on June 9, 2026 at 12:47 am

    It might be that your IDE doesn’t understand the >> in your template specification. Older versions of the C++ standard required that you put a space in between each > as in > >, otherwise it could be confused with the right shift operator >>. So:

    std::back_inserter<std::vector<float> >(model.chunks.back().vectices));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
Hey guys (and gals) I'm having a problem using Assembly GetExportedTypes() in .NET 4.0.
Hey guys I just noticed that my join statement here SELECT * FROM reports
hey guys should be a easy one...I have some javascript that is turning my
Hey guys. Working on Mac OSX 10.6, My problem is that I would like
Hey guys - I am having trouble setting up my Django urls file correctly
Hey guys, I'm having a bit of trouble with my ASP:RadioButtonList, searched Google and
hey guys hope you can help me out, I am having a weird problem.
...hey guys, here is the view code in question... <td> <%= f.radio_button :score, '4'
Hey guys a bit stuck here. Ill first start with showing you the 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.