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

  • Home
  • SEARCH
  • 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 496007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:38:44+00:00 2026-05-13T05:38:44+00:00

Unfortunately I still got a problem with my templated code from here: C++ fancy

  • 0

Unfortunately I still got a problem with my templated code from here:

C++ fancy template code problem

on line 49 in the file ‘utility’:

error C2440: 'Initializing': cannot convert from 'const int' to 'IntersectionData *'

error C2439: 'std::pair<_Ty1,_Ty2>::second': member could not be initialized

how could i figure out where the problem is? the only place i use a pair with ‘IntersectionData*’ is here:

#include "MRMaterialMatth.h"
#include "IntersectionData.h"
using namespace std;

struct IShaderMatth {
 virtual ~IShaderMatth() {}
 vector<pair<MaterialMatth,IntersectionData*> > traceCols; 
};

and there are not any other compiler errors

how can I track down this?

//edit: utility is not my code. it must be from std.. the code of line 49 looks like this:

template<class _Other1,
    class _Other2>
    pair(const pair<_Other1, _Other2>& _Right)
    : first(_Right.first), second(_Right.second)
    {   // construct from compatible pair
    }

line 49 is the line of the comment

edit2:
the only places where i change something about the content of tracecols look like this:

            IntersectionData* iDataOut = NULL;
            if(newIData_out!=NULL)
            {
                iDataOut = new IntersectionData(*iData);
            }
            traceCols->push_back(make_pair(MaterialMatth(),iDataOut));

and

    if(traceCols){
        traceCols->push_back(make_pair(MaterialMatth(), NULL));
    }

and

        if(traceCols)
        {
            (*traceCols)[traceCols->size()].second = new IntersectionData(*newIData);
        }

is NULL the problem? it’s a pointer, so i should be allowed to create a pair with NULL, no??

  • 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-13T05:38:44+00:00Added an answer on May 13, 2026 at 5:38 am

    Try explicitly casting the NULL to IntersectionData * in your call to make_pair().

    if(traceCols){
            traceCols->push_back(make_pair(MaterialMatth(), (IntersectionData *)NULL));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager
I've seen various other posts about this, but unfortunately I still haven't been able
I'm trying to use eclipse encoding UTF-8, for polish characters. Unfortunately, I still have
Unfortunately I am not writing this question from my Developing PC so I might
I've got problem with rake tasks. When I tried to execute any rake task
I've got a problem with Joomla 1.5.+, hope you can help me. I installed
I've got the following problem: My Flashlight app works fine on my Samsung Galaxy
Hi i've got the following code in a ViewController.h: #import <UIKit/UIKit.h> @interface CalcViewController :
If you don't know what the operation aborted error is, here's a Microsoft KB
I've got a problem, that swing components in different parts of program have sometimes

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.