generic set constructor