// // custom.hpp // // Copyright (c) 2001 by Michael S. Kenniston. The most recent // version will be available at www.boost.org. Permission is granted // to use this code without restriction so long as this copyright // notice appears in all source files. // This code is provided as-is, with no warrantee of correctness. // This file simply demonstrates how a programmer can add more // physical quantity types and units without modifying the // library. #ifndef _BFAFCE66_5FA7_11d5_B9D8_000000000000 #define _BFAFCE66_5FA7_11d5_B9D8_000000000000 #include "quantity.hpp" namespace quantities { // warp factor dimensions are m-2 kg+3 s-1 A typedef dimensions< -2, 3, -1, 1 > warp_factor_d; // standard unit of measurement for warp factor is the Scotty inline quantity< warp_factor_d > scotty() { return 1.0 / meter() / meter() * kilogram() * kilogram() * kilogram() / second() * ampere(); } } // namespace quantities // // You can now say things like: // // warp_factor_t full_power = 3.27 * mega() * scotty(); // #endif // _BFAFCE66_5FA7_11d5_B9D8_000000000000