CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 12 of 12

Threaded View

  1. #1
    Join Date
    May 2015

    casting pointer to template type


    I have another circular dependency issue, so was trying to handle by changing the variable access, to pointer type.

    But the pointer is for templated class.

    Basically i had
    					OnePixel<float> fraster(pfVal);
    					RenderFuncParams rfp;
    					rfp.displayDataType = eDDT;
    					rfp.pInstance		= pInstance;
    					rfp.pfOut			= &fraster;
    when i got circular dependency issue. I tried the following
    float val = 0.0;
    OnePixel<float> * pfraster = &val;

    obviously gives error. But

    OnePixel<float> * pfraster = static_cast<(OnePixel<float> *)>(&val);

    even gives error " error C2681: 'float *': invalid expression type for dynamic_cast

    thanks a lot
    Last edited by pdk5; January 15th, 2022 at 04:52 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width