Resource Management - Files

This is a discussion on Resource Management - Files within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by laserlight That depends on whether RAII is the only thing that you are trying to cut Yeah, ...

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,934
    Quote Originally Posted by laserlight View Post
    That depends on whether RAII is the only thing that you are trying to cut
    Yeah, but you did say you wrote your own RAII wrappers.

    Quote Originally Posted by darren78 View Post
    Okay, cheers. The book i'm using only really touches briefly on auto_ptr and advocates the use of constructors/destructors for aquiring resources, etc.
    Ah, unless you don't have access to C++0x, don't use auto_ptr. It's dangerous and deprecated. In C++0x and forward, you should use unique_ptr instead.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,639
    Quote Originally Posted by Elysia
    Yeah, but you did say you wrote your own RAII wrappers.
    Yes, and RAII is an important part. But the wrapper is another important part, i.e., a further level of abstraction.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,934
    True that, but was it worth time investigating in? It hardly seems like a thing a newbie would need.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,639
    Quote Originally Posted by Elysia
    True that, but was it worth time investigating in? It hardly seems like a thing a newbie would need.
    Custom deleters are hardly things that a newbie would need. Is it worth time investigating them? In my opinion, this depends on the path of learning that the newbie wishes to take. Seeing that darren78 started thinking about files, thinking about databases is along similiar lines.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,934
    But then it becomes a question of what is better - custom RAII wrappers or just custom deleters? Since custom deleters usually provide less work, they're more newbie friendly and integrates well with the STL.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  2. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  3. Multiple Resource files
    By doodlak in forum C++ Programming
    Replies: 0
    Last Post: 07-04-2002, 06:13 PM
  4. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 08:35 AM
  5. Problems with resource files
    By Unregistered in forum C++ Programming
    Replies: 18
    Last Post: 08-31-2001, 08:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21