c++ - return NULL value -


snippets of framebufferd3d11.h

namespace dx11 { ... class framebuffermanager : public framebuffermanagerbase { public:    ... private:    ...    static struct efb    {       ...       std::unique_ptr<d3dtexture2d> resolved_color_tex;       std::unique_ptr<d3dtexture2d> resolved_depth_tex;    } m_efb; }; } //namespace 

snippets of framebufferd3d11.cpp

namespace dx11 { ... framebuffermanager::efb framebuffermanager::m_efb; ... framebuffermanager::framebuffermanager() {    ...    m_efb.resolved_color_tex = null;    m_efb.resolved_depth_tex = null; } } //namespace 

if compile icc, problem null assign value, null defined 0. how solve problem this?

your code correct. of following should work:

m_efb.resolved_color_tex = 0; m_efb.resolved_color_tex = null; m_efb.resolved_color_tex = nullptr; 

a null pointer constant (like 0 or null) implicitly convertible nullptr_t , unique_ptr has assignment operator takes nullptr_t. if version of icc using not yet support nullptr, explain why assignment of null doesn't work you.

you may have better luck using reset():

m_efb.resolved_color_tex.reset(null); 

or, since null default argument:

m_efb.resolved_color_tex.reset();  

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -