Turboscreen news

Pages: 12
using now does a lot more than that. see the link... ^^^
you never used typedef?! wow :) they really help for stupidly long types like vector< vector < something > > if you have a lot of a recurring complex type. There are also some mad hax you can do with them, like reshape 1d to 2d.
There is absolutely no reason to pretend that typedef is now deprecated or frowned upon. Yes, using can do something we can consider practically equivalent, but typedef works just fine doing exactly what it is designed to do.
Heh, I don't often use stupidly long types, so that shouldn't be an issue.

My 2 cents: Using "typedef" would be easier to understand visually than using "using." If you see something like
 
typedef std::vector <std::vector <int>> 2D_LIST;

to me that's just less confusing than something like
 
using 2D_LIST = std::vector <std::vector <int>>;

because I'm used to using "using" mainly just for namespaces.

Of course, using "using" might be easier for some people who prefer = signs.

I'm using the word "using" way too much in here...
Last edited on
I don’t think you were using using too much. In fact, using “using using” in a complete sentence is a great way of using grammar for useless ‘using’ fun.

I could go on, of course, using “using ‘using using’” indefinitely, but then I would be using too many quotes to quote the usings, and people would get lost...
and I hope they stop deprecating old stuff without reason. The c++ language growth patterns really frustrate me -- so much of what they do seems more theoretical than practical lately. The templated type-def looks neat on paper, but ... I can't see myself using it much: now your vector<double> becomes a mything<double> ... you don't save a lot there if the goal was to get rid of the template clutter.

Eh, it can help. The point is that stuff like
std::set<std::string, my_compare<std::string>, my_allocator<std::string>>
Becomes
my_set<std::string>
Via the template alias
template <typename T> using my_set = std::set<T, my_compare<T>, my_allocator<T>>;.

In C++98 you'd have to
1
2
3
4
5
6
template <typename T> 
  struct my_set_fn 
  {
    // using type = std::set<T, my_compare<T>, my_allocator<T>>;
    typedef std::set<T, my_compare<T>, my_allocator<T>> type;
  };


And that just gets you the less compact
typename my_set_fn<std::string>::type
Which is still occasionally better than repeating std::string three times but getting it wrong once, then spending ten minutes to find the typo.
Last edited on
Definitely. I taught myself C++98 back in '04 and '05 and I often wished there were more compact. easier to read versions of some things, like the template typedef stuff.
Back to the original post. I've tried using TurboScreen 0.0.1 and ran into a number of problems which I posted in your forum.

Frankly I don't understand your penchant for using your own names. For example, you define the RGBA macro for defining RGB values (which by the way is wrong). Microsoft already provides the RGB macro which correctly initializes RGB values. MS documents that the fourth byte is undefined and MUST be zero. You initialize it to 255. Why does the user need to learn another macro when the original is well known and under4stood?

In a number of cases, your names just lead to reader confusion. For example, TS_STRING: Without referring to your source code, it not clear if this is an alias for std::string or for Microsoft's CSTRING or some other string type. Again, why does the reader need to learn another set of names when the original is well known and understood.

On the subject of typedefs for crazy long names, I am in favor of that. In fact, I tend to use typedefs for inherited types where the type is a templated type. Example:
1
2
typedef vector<foo> foovec_t;
class bar : public foovec_t





Topic archived. No new replies allowed.
Pages: 12