$ clang++ main.cpp -std=c++11 -o main && ./main
Converting red to string: red
Converting 2 to enum to string: yellow
Converting 20 to enum to string: undefined
Converting 20 to enum to int: 20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use text_io::try_read; | |
use std::io; | |
use std::io::prelude::*; | |
use std::cmp::Ordering; | |
use std::fmt; | |
pub enum BST<T: Ord+fmt::Display> { | |
Leaf { | |
value: T, | |
left_child: Box<BST<T>>, |
OlderNewer