It then calls the friend function spacefriend and passes the class object address as its argument, and calls the template function, beginning with integer types and then floating data types.
然后,调用友元函数spacefriend并将类对象的地址作为其参数传递。然后调用template函数,先使用整数类型,然后使用浮点数据类型。
If you need another data type such as integer, floating point, or Boolean value, you will have to parse the string using the appropriate wrapper class.
如果需要其他的数据类型,比如说整数、浮点数或者布尔值,必须使用相应的包装器类来解析字符串。
In Listing 2, I reopen the Numeric class (which handles both fixed and floating-point Numbers) to add the gram and pound methods.
在清单2中,我重新打开了numeric类(其处理固定和浮点数字)以便添加gram和pound方法。
应用推荐