How to keep Nil from reverting container to its default value?
问题 I'm implementing a simple linked list and to denote the fact that there is no next node, I'm using the value Nil . The thing is that when assigned to a container, Nil will attempt to revert the container to its default value which means I need to use the container's default value or Any to determine if the linked list's end has been reached. However, I'd still like to use Nil (if only for its clear intent) and no other value to test for the non-existence of a next node in the code (e.g.,