using System.Collections;
using System.Collections.Generic;
public class FooList : IEnumerable<Type> {
private HashSet<Type> m_Types = new HashSet<Type>();
public bool Add(object value) => value is null
: m_Types.Add(value.GetType());
public IEnumerator<Type> GetEnumerator() => m_Types.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => m_Types.GetEnumerator();
public static void Main() {
FooB anotherFooB = new FooB();
FooList list = new FooList();
foreach(var item in list)