Original Post
i''ve been reading through the "Creating a Scripting System" series and i''m seeing a convention i''ve never seen before. i can''t think of a way to phrase it into a google search, so this forum is my only recourse.
this is the instruction class, it encapsulates an enumerated opcode and its optional data component, not yet implemented. the part that is throwing me off is the : (colon) in the constructor... what the heck is that for? and the _code(code), how is that legal? looks like a function but it''s just an enum... i''m at a serious loss here. i''d appreciate any help
// the basic instruction, currently just encapsulating an opcode
class Instruction
{
public:
Instruction(opcode code) : _code(code) {}
opcode Code() const { return _code; }
private:
opcode _code;
//char* _data; // additional data, currently not used
};