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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:50:32+00:00 2026-05-24T05:50:32+00:00

Both SGI slist and C++11 std::forward_list appear identical to me unless I have missed

  • 0

Both SGI slist and C++11 std::forward_list appear identical to me unless I have missed something; both implement a singly-linked list.

I assume there is a difference though as the C++ Standard Commitee didn’t adopt the name slist and instead chose a new name, forward_list, when they added the container into the Standard Library for C++0x.

  • 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-24T05:50:33+00:00Added an answer on May 24, 2026 at 5:50 am

    One major difference is that std::forward_list lacks a size() member function, where as the sgi::slist doesn’t. The motivation for this is that an O(N) size() has been problematic. N2543 has more details on the design decisions for forward_list.

    Update:

    I recently had a good excuse to look closer at this subject. slist also has other member functions that one would be tempted to think are O(1), but are really O(N). These include:

    iterator previous(iterator pos);
    const_iterator previous(const_iterator pos) const;
    iterator insert(iterator pos, const value_type& x);
    iterator erase(iterator pos);
    void splice(iterator position, slist& x);
    void splice(iterator position, slist& x, iterator i);
    

    In short, if you’re not very careful, you can end up with significant performance problems by using slist. Use of std::forward_list instead ensures that you’ll get the expected O(1) performance out of your singly linked list.

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

Sidebar

Related Questions

Both Ruby and Python have the ability of calling the debugger from code (
Both are delegates and have the same signature, but I can not use Action
Both the MySQLi and MySQLi_STMT classes have an $insert_id property. If I am connected
Both ideone.com and codepad.org have Little-Endian architechtures. I want to test my code on
Both offer policies which have to be enforced and are similar in operation. There
Both Macro expansion & Code generation have pros & cons. What's your favorite approach
Both list and islice objects are iterable but why this difference in result. r
Both firefox's js engine/gjs (spidermonkey) and webkit's jscore seems to have different behavior when
Both ArrayController and CollectionView have same functionality to render 'content' array using template, except
Both source and destination tables have about 40 columns. No. of rows to be

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.