Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Why struct instead of class?
Re: Why struct instead of class? [message #21825 is a reply to message #21815] Sun, 07 June 2009 21:46 Go to previous message
mirek is currently offline  mirek
Messages: 14262
Registered: November 2005
Ultimate Member
jeremy_c wrote on Sat, 06 June 2009 00:47

Why do the example use struct instead of class? i.e.

struct MyAppWindow : TopWindow {

    virtual void Paint(Draw& w) {

        w.DrawRect(GetSize(), SWhite);

        w.DrawText(20, 20, "Hello world!", Arial(30), Magenta);

    }

    

    MyAppWindow() {

        Title("My application").Zoomable().Sizeable();

    }

};


Jeremy



Because I am lazy to write "public" for "final use" classes:)

I mean, access control is important for reusable classes. But if I am writing concrete app, I usually do not bother using access control as chances that class is going to be reused by other code is nil.

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: Heap Leaks Detected
Next Topic: Keyboard shortcut
Goto Forum:
  


Current Time: Sat Jun 28 04:20:51 CEST 2025

Total time taken to generate the page: 0.03938 seconds