brucem added a comment. It doesn't seem right to have a strong construction and copy just to determine the length or if it is empty or not as in your examples. That would be appropriate for a helper function. http://reviews.llvm.org/D13094