⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function_template.h

📁 Kluwer.Academic.Pub.Systemc.From.The.Ground.Up-此全书的范例程式。
💻 H
字号:
#ifndef FUNCTION_TEMPLATE_H#define FUNCTION_TEMPLATE_H//BEGIN function_template.h//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// DESCRIPTION//   Example of a C++ templatized function.//   Compute the distance between two Cartesian//   points expressed with any data type that//   supports addition, multiplication, and sqrt().//// NOTE: This does not require SystemC.//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~template <typename T>T Distance(const T sx,const T sy, const T ex,const T ey) {  T dx = (sx - ex);  T dy = (sy - ey);  return (T)sqrt(dx*dx + dy*dy);}#endif//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//END $Id: function_template.h,v 1.2 2004/04/15 17:39:51 dcblack Exp $

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -