
28 Feb
2010
28 Feb
'10
8:50 a.m.
Daniel Trebbien wrote:
I have a small library that is intended for convenient and declarative resource wrappers creation.
Read Documentation: http://rain.ifmo.ru/~sorokin/rcpp/doc/index.html
Main Page: http://rain.ifmo.ru/~sorokin/rcpp/
What is the safe_bool stuff for; or, why have you implemented `operator sb_type() const` rather than `operator bool() const` for evaluating a `resource` as a `bool`?
Consider: struct T { operator bool(); }; void f() { T a, b; a + b; // correct (convert to bool and add) a * b; // as well a / b; a < b; } I want to have possibility to write objects of my class under if and while, but without addition, multiplication, etc So instead of operator bool I use operator to member-function.