Tag Archives: C++

Friends of Template Classes

A problem that I have been struggling with for some days. When I declare a template function as a friend of a template class, I'll get a compile error, such as the following: And I'll get a compile error message: undefined reference to 'operator< <(std::ostream&, test const&)' Finally, I found that we couldn't declare a friend function like that, we need to specify a different template type for it.

Continue Reading

C# - Run Application as Administrator Automatically

In this tutorial, you will learn how you can run your application as an administrator automatically using Visual C#2012. Start by opening your C# Windows forms application. Right click on your project name in the solution explorer and add a new item... Select an application manifest file: Click add. A new tab should open up, most of the codes in it are not important to us.There is one line however that we need to change: Change asInvoker to requireAdministrator as follows: Save your application and rebuild it. You can only open your executable when using Administrator rights. If you have any more questions, please leave them in the comment section below. Have a nice day!

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com