瀏覽代碼

Allow ! and bool operators on polynomials.

This allows us to manipulate polynomials of polynomials. Not sure why yet,
but it could be useful to implement 2-variable polynomials.
legacy
Sam Hocevar 7 年之前
父節點
當前提交
1db2c5ca0f
共有 1 個檔案被更改,包括 11 行新增0 行删除
  1. +11
    -0
      src/lol/math/polynomial.h

+ 11
- 0
src/lol/math/polynomial.h 查看文件

@@ -274,6 +274,17 @@ struct LOL_ATTR_NODISCARD polynomial
return (*this)[degree()];
}

/* Boolean operations */
bool operator !() const
{
return degree() < 0;
}

operator bool() const
{
return !!*this;
}

/* Unary plus */
polynomial<T> operator +() const
{


Loading…
取消
儲存