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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:26:25+00:00 2026-05-20T06:26:25+00:00

I wrote a link list class and now besides the type of the cur

  • 0

I wrote a link list class and now besides the type of the cur object it can handle now.

I’m interested in reusing the code so it can handle another object.

I was thinking something maybe like this? Right now my current classes are truck and events and I have a linklist class. By using the linklist class it’s right now setup for events, but trucks will have the same kinda behavior in the linklist it will just be a few minors changes to the list. Instead of just copying it and reusing it like that. Could I setup both Truck and Events to be a Item? so Item is the base class and Truck and Events inherit from Item. SO that then I can pass in the truck and event into the list as items, would this work?

Or templatize the list?

  • 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-20T06:26:26+00:00Added an answer on May 20, 2026 at 6:26 am

    A template is definitely the right choice. All of us who’ve been around since before templates were available can attest to their superiority over the alternatives.

    Of course, unless you have some overwhelming reason to write your own, you’re probably better off using std::list (or, perhaps, Boost slist).

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

Sidebar

Related Questions

http://ideone.com/u0bVy the link above contain the code that i wrote for a class project.I
I just switched to C++ from C# I wrote a link list code in
I wrote a code to show a div element(shareform) when a link is clicked
I wrote a code that whould change a li's class to active and show
I am trying to serialize a list of model object defined as: class AnalysisInput(models.Model):
This simple script adds an active class to a link in a list when
I wrote a template class which extends STL list for some use. I declare
I wrote this code in controller: def list @codes = Code.order(created_at) @languages = Language.order('name').collect
I wrote an Android App using the Mixare ( link to mixare project )
I wrote the function using js+jQuery. Here is a link to a jsFiddle which

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.