Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Direct Input

Sign in to follow this  


I moved my previous Direct Input code over to my new project, making a few ultimately minor changes in the process. I also switched from using an abstracted collection class to just exposing std::vector directly. I do still have a problem with providing both a const and non-const version of the functions that return collections, however. Normally I just return a const reference or a non-const reference, but in this case, the container still needs to remain const in both versions, but the elements need to be non-const in the non-const version of the function. I might want to write some form of abstraction anyway, and will likely be tempted to reintroduce the container agnosticism, supporting any container that provides bidirectional iterators. For now, I just return a non-const reference, and will just depend on my responsibility to not actually modify the container, just elements.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!