Velocity renamed to Speed (resolves #103)

This commit is contained in:
Mateusz Pusz
2020-05-10 17:31:47 +02:00
parent f70d6d0be1
commit ce301748dd
42 changed files with 151 additions and 150 deletions
+4 -4
View File
@@ -20,13 +20,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/physical/si/velocity.h>
#include <units/physical/si/speed.h>
#include <iostream>
namespace {
template<units::physical::Length D, units::physical::Time T>
constexpr units::physical::Velocity AUTO avg_speed(D d, T t)
constexpr units::physical::Speed AUTO avg_speed(D d, T t)
{
return d / t;
}
@@ -38,10 +38,10 @@ void example()
Length AUTO d1 = 123q_m;
Time AUTO t1 = 10q_s;
Velocity AUTO v1 = avg_speed(d1, t1);
Speed AUTO v1 = avg_speed(d1, t1);
auto temp1 = v1 * 50q_m; // produces intermediate unknown dimension with 'unknown_coherent_unit' as its 'coherent_unit'
Velocity AUTO v2 = temp1 / 100q_m; // back to known dimensions again
Speed AUTO v2 = temp1 / 100q_m; // back to known dimensions again
Length AUTO d2 = v2 * 60q_s;
std::cout << "d1 = " << d1 << '\n';