Click here to Skip to main content
12,451,425 members (49,704 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.4K views
Posted

Passing Enum type as a parameter

, 24 Aug 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
I think the compile time force for a little enum enforcement would look something like this... (excuse the bad syntax, doing it from memory)private T GetPreviousEnum(this T currentlySelectedEnum) where T: structStackOverflow has a good question and answer in relation to it here.[^].

I think the compile time force for a little enum enforcement would look something like this... (excuse the bad syntax, doing it from memory)

private T GetPreviousEnum<T>(this T currentlySelectedEnum) where T: struct

StackOverflow has a good question and answer in relation to it here.[^].

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Daniel Gidman
Architect Stackify
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 24 Aug 2011
Article Copyright 2011 by Daniel Gidman
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid