Interface IStack


The following pseudocode

template<typename T>
interface IStack {
    bool empty() const;
    void push(const T&);
    void pop();
    T& top();
    const T& top() const;
};

can be rendered in the Interface Definition Language (IDL) as follows:

template<typename T>
BOOST_IDL_BEGIN1(IStack)
    BOOST_IDL_CONST_FN0(empty, bool)
    BOOST_IDL_FN1(push, void, const T&)
    BOOST_IDL_FN0(pop, void)
    BOOST_IDL_FN0(top, T&)
    BOOST_IDL_CONST_FN0(top, const T&)
BOOST_IDL_END1(IStack)

Sha'arei Tefila, an Orthodox Shul (Synagogue) in Salt Lake City, Utah Chabad Lubavitch of Utah