Monday, December 16, 2013

templates help

Newsgroup: comp.lang.c++

Subject: templates help

From: Devender Rao <mdevender@...>

Date: Mon, 16 Dec 2013 05:48:57 -0800 (PST)



I am having code from a library as shown below. I am not able to understand the purpose of "class ErrorAccessingPrivilegedAttribute;". Not sure how it works.





#define FAPI_ATTR_GET(ID, PTARGET, VAL) \

(fapiFailIfPrivileged<fapi::ID##_Privileged>(), \

fapiCheckIdType<fapi::ID##_Type>(ID, VAL), \

ID##_GETMACRO(ID, PTARGET, VAL))



template<typename T> inline void fapiCheckIdType(AttributeId, T &) {}



class ErrorAccessingPrivilegedAttribute;

template<const bool PRIVILEGED> void fapiFailIfPrivileged()

{

ErrorAccessingPrivilegedAttribute();

}

template <> inline void fapiFailIfPrivileged<false>() {}



Thank you in advance for any help.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?152099-templates-help&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment