Jump to content

Can pow() be directly used as size of port during port declaration?


Recommended Posts

This question has nothing to do with SystemC. If you have a C++ class templatized on a numeric, can you pass a non-const parameter to it?

// Given:
template<int N>
class Foo { ... };

int bar() { ... };
int i;

// Is this legal?
Foo<bar()> f0;
// Or even:
Foo<i> f1;

For what you are trying to do, `pow(2, N)` can be replaced with `1<<N`

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...