Skip to content

Commit a291e98

Browse files
committed
Add comment
1 parent d424668 commit a291e98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/numpy_cpp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ class array_view : public detail::array_view_accessors<array_view, T, ND>
479479
return m_shape[i];
480480
}
481481

482+
/*
483+
In most cases, code should use size() instead of dim(0), since
484+
size() == 0 when any dimension is 0.
485+
*/
482486
size_t size() const
483487
{
484488
bool empty = (ND == 0);

0 commit comments

Comments
 (0)