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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:52:01+00:00 2026-06-17T10:52:01+00:00

So I have a structure which hold many members including a boost shared pointer

  • 0

So I have a structure which hold many members including a boost shared pointer to a PCLVisualizer object. The PCLVisualizer class is a templated class with a member function updatePointcloud. I am trying to call updatePointCloud for template PointType. Please see code below:

template <typename PointType>
class A {
    struct gt_data_type {
        model_struct line;
        PointCloudTPtr input;
        PointCloudTPtr output;
        int step_size;
        int segment_min_pts;
        vector<float> directions;
        float current_direction;
        vector<line_segment> seeds;
        Eigen::Vector4f prev_vector;
        Eigen::Vector4f current_vector;
        Eigen::Vector4f p;
        typename pcl::search::KdTree<PointType>::Ptr tree;
        pcl::visualization::PCLVisualizer::Ptr viewer;
        line_segment prev_segment;

    };

    gt_data_type gt_data;


    void foo(PointCloudTPtr output) {
        pcl::visualization::PCLVisualizer::Ptr viewer(new pcl::visualization::PCLVisualizer("Track Viewer"));
        gt_data.output = output;
        gt_data.viewer = viewer;
        // next line causes compile error
        gt_data.viewer->updatePointCloud<PointType>(gt_data.output,"rail");
    }

}

Note that PointCloudTPtr is just a typedef for different shared_ptr. I get the following error at the line indicated:
expected primary-expression before '>' token

If I omit the struct and call the viewer member function directly by doing this:
viewer->updatePointCloud<PointType>(gt_data.output,"rail");

my code compiles. I don’t understand why accessing the viewer through a struct makes any difference.

Any help is 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-17T10:52:02+00:00Added an answer on June 17, 2026 at 10:52 am

    The sample you posted should work fine. Unless you actually meant to call viewer on a type instead of a variable. However, if gl_data is itself a template or dependent on a template parameter, then the compiler wouldn’t know if you are writing a function call or a comparison expression. And from the looks of your code, it seems that it is dependent on the template parameter PointType.

    Just as typename is needed to disambiguate between a type and a variable, template is needed to disambiguate between a template and a comparison:

    data.viewer->template updatePointCloud<PointType>(data.output,"rail");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data structure which is as given below: class File { public
I have a data structure (which is a class) called user_class and I want
I have a class called Program which hold a grid. It has two methods
I have a structure which has 3 identifier fields and one value field. I
I have a structure which aims at storing user defined data (i.e. from a
I have a structure which contains character array on C side stuct s {
Iam struggling with NHibernate and its lazyload. I have a structure which I simplified
I have such XML structure which was returned by SharePoint web services. <rs:data ItemCount=4
I have a data structure which uses composite ids (Which I dont wish to
I have a C code in which I have a structure declaration which has

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.