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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:27:30+00:00 2026-06-04T17:27:30+00:00

I’m currently trying to learn how to use boost library and I’ve stumbled upon

  • 0

I’m currently trying to learn how to use boost library and I’ve stumbled upon a problem with boost::intrusive::splay_set (or splaytree in that matter).

Let’s assume I want to have splay tree that keeps pointers to Category class (so Category*). I’m trying to write following

splay_set<Category*, compare<std::greater<Category*>>> CategoriesSplay

Sadly, it doesn’t work. I won’t write errors it’s generating since it’s exceeding 100 and Visual Studio is terminating compilation process.

Then I tried to change class that my Category class should be extending to

class Category : public splay_set_base_hook<link_mode<auto_unlink>, Category*> 

Again, no luck here. changing Category* in 2nd code to void_pointer(Category) doesn’t work either. Sadly boost documentation is no help in adding pointers to intrusive splay sets.

Have anyone got some solution to my problem? Thanks in advance.

  • 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-04T17:27:32+00:00Added an answer on June 4, 2026 at 5:27 pm

    Two things:

    First, you shouldn’t store a pointer to your object, you should store the actual object. So your declaration should look like this:

    splay_set<Category, compare<std::greater<Category>>> CategoriesSplay
    

    Second, you need to implement the data members in your class that the container needs to do its work. The easiest way is to just inherit from the base “hook” class, like so:

    class Category : public splay_set_base_hook<> {
    ...
    

    Remember: the intrusive containers do not manage the memory of their contained objects the way the STL containers do. You need to allocate your object before you insert it into the container and make sure you delete it when you remove it.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.