添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
constexpr float y{108}; constexpr float z = exp(5, 3); constexpr int i; // Error! Not initialized int j = 0; constexpr int k = j + 1; //Error! j not a constant expression constexpr auto degrees_to_radians(const double degrees) { return degrees * (M_PI / 180.0); constexpr int sum(int n) { if (n > 0) { return n + sum(n - 1); return n; template auto get_value(T t) { if constexpr (std::is_pointer_v) { return *t; } else { return t; int _tmain(int argc, _TCHAR* argv[]) { constexpr int i = 1 + 2; constexpr int j = method_call(5, 10); constexpr auto radians = degrees_to_radians(90); constexpr auto sum_one_to_ten = sum(10); int a = 5; int* pa = &a; int at = 5; int* pt = &at; auto value_a = get_value(a); auto value_pa = get_value(pa); std::cout << value_a << std::endl; std::cout << value_pa << std::endl; system("pause"); return 0;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR ;
#define _tmain main
#endif
#include <cmath>
#include <iostream>
#include <memory>
constexpr int method_call ( int a , int b ) {
return a * b ;
}
constexpr auto degrees_to_radians ( const double degrees ) {
return degrees * ( M_PI / 180.0 ) ;
}
constexpr int sum ( int n ) {
if ( n > 0 ) {
return n + sum ( n - 1 ) ;
}
return n ;
}
template < typename T >
auto get_value ( T t ) {
if constexpr ( std :: is_pointer_v < T > ) {
return * t ;
} else {
return t ;
}
}
int _tmain ( int argc , _TCHAR * argv [ ] ) {
constexpr int i = 1 + 2 ;
constexpr int j = method_call ( 5 , 10 ) ;
constexpr auto radians = degrees_to_radians ( 90 ) ;
constexpr auto sum_one_to_ten = sum ( 10 ) ;
int a = 5 ;
int * pa = &a ;
int at = 5 ;
int * pt = &at ;
auto value_a = get_value ( a ) ;
auto value_pa = get_value ( pa ) ;
std :: cout << value_a << std :: endl ;
std :: cout << value_pa << std :: endl ;
system ( "pause" ) ;
return 0 ;
}
Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today

Free Delphi Community Edition Free C++Builder Community Edition
Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Upgrade Today

Free Delphi Community Edition

Free C++Builder Community Edition
  • カテゴリー

    C++ 295 Delphi 534 IDE 36 InterBase 18 RAD Studio 190 アップデート 44 インタビュー 5 データベース 25 ニュース 253 事例 236 調査 14
  • 人気の記事

    Delphi

    Google Book APIを使ってISBNコードから書籍情報を取得する

  • C++ Delphi データベース

    基礎から学べるFireDACデータアクセス再入門(第3回)

    C++ Delphi RAD Studio

    RAD Studio 10.4.2で提供される2つの新しいVCLコントロール

    C++ ニュース

    最新のC++Buidlerで旧バージョンのプロジェクトを利用する方法

    RAD Studio 10.4の新機能: 新しいVCL TEdgeBrowserコンポーネント

  • RSS Newest questions tagged delphi – Stack Overflow

  • RSS Newest questions tagged delphi – Stack Overflow

  • RSS Newest questions tagged interbase – Stack Overflow

  • RSS delphi タグが付けられた最新の質問 – スタック・オーバーフロー

  • Embarcaderoのユーザーは、C ++およびDelphiプログラミングのスケーラビリティと安定性を理解しており、これらの言語が開発にもたらす何十年にもわたる革新に依存しています。 Fortune 100の90社と、世界中で300万人を超えるユーザーが参加する活発なコミュニティは、過去30年間、エンバカデロの受賞歴のある製品に依存してきました。

    © 2020 EMBARCADERO INC. ALL RIGHTS RESERVED