Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Ivor Horton's Beginning Visual C++ 2013
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2013 by Ivor Horton; ISBN: 978-1-118-84571-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2013 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 1st, 2015, 02:58 PM
Aza Aza is offline
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Dec 2015
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default "#include" in .h or .cpp

I've read this doggone passage (at the bottom of page 395 and top of 396) over and over but somehow it ain't registering.

"First, add the '#include' directive for the 'utility' header to Box.h and then add the following 'using' directives:
<Code snipped out>
This makes the names of the templates for the comparison operators in the 'std::rel_ops" namespace available. You should never add a 'using namespace' to a header file so the only alternative to the declarations above would be to define the comparison operator functions yourself."

It seems to be saying "do this" and then "but that's not a good idea", yet page 398 says"

... the class definition in 'Box.h' will look something like this:

#pragma once
#include <utility> // For operator overload templates
using namespace std::rel_ops;

class CBox

Would any of my fellow pilgrims offer a bit of insight here before I find myself bouncing off the walls in a padded room?


Aza D. Oberman

Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
Difficulties with "web.config" and "ASPNETDB" CFRham BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 2 July 3rd, 2010 10:19 AM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.